# `Otera.Bytes`
[🔗](https://github.com/georgeguimaraes/otera/blob/v0.1.0/lib/otera/bytes.ex#L1)

A Python `bytes` value, which `str.encode()` gives. It prints like Python, such as `b'caf\xc3\xa9'`, has a length in bytes, iterates as integers, and `decode()` gives the string back.

# `t`

```elixir
@type t() :: %Otera.Bytes{data: binary()}
```

# `decode`

```elixir
@spec decode(t(), String.t()) :: String.t()
```

Decodes `bytes` like `bytes.decode(encoding)`.

# `encode`

```elixir
@spec encode(String.t(), String.t()) :: t()
```

Encodes `string` like `str.encode(encoding, errors)`, for the codecs UTF-8, ASCII and Latin-1 with strict errors.

# `repr`

```elixir
@spec repr(t()) :: String.t()
```

Returns the Python `repr()` of `bytes`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
