# `Exiffer.Binary`

Documentation for `Exiffer.Binary`.

# `rational`

```elixir
@type rational() :: {non_neg_integer(), non_neg_integer()}
```

# `signed_rational`

```elixir
@type signed_rational() :: {integer(), integer()}
```

# `big_endian`

```elixir
@spec big_endian(binary()) :: binary()
```

Force big endian byte order

# `big_endian_to_current`

```elixir
@spec big_endian_to_current(binary()) :: binary()
```

Convert big endian to the currently selected byte order

# `big_endian_to_integer`

```elixir
@spec big_endian_to_integer(binary()) :: non_neg_integer()
```

Convert big-endian binary bytes to an integer.

# `big_endian_to_signed`

```elixir
@spec big_endian_to_signed(&lt;&lt;_::32&gt;&gt;) :: integer()
```

# `byte_order`

```elixir
@spec byte_order() :: :big | :little
```

# `int16u_to_big_endian`

```elixir
@spec int16u_to_big_endian(integer()) :: &lt;&lt;_::16&gt;&gt;
```

Convert a 16-bit integer to big-endian binary bytes.

# `int16u_to_current`

```elixir
@spec int16u_to_current(integer()) :: &lt;&lt;_::16&gt;&gt;
```

Convert a 16-bit integer to binary bytes in current byte order.

# `int16u_to_little_endian`

```elixir
@spec int16u_to_little_endian(integer()) :: &lt;&lt;_::16&gt;&gt;
```

Convert a 16-bit integer to little-endian binary bytes.

# `int32s_to_big_endian`

```elixir
@spec int32s_to_big_endian(integer()) :: &lt;&lt;_::32&gt;&gt;
```

# `int32s_to_current`

```elixir
@spec int32s_to_current(integer()) :: &lt;&lt;_::32&gt;&gt;
```

# `int32s_to_little_endian`

```elixir
@spec int32s_to_little_endian(integer()) :: &lt;&lt;_::32&gt;&gt;
```

# `int32u_to_big_endian`

```elixir
@spec int32u_to_big_endian(integer()) :: &lt;&lt;_::32&gt;&gt;
```

Convert a 32-bit integer to big-endian binary bytes.

# `int32u_to_current`

```elixir
@spec int32u_to_current(integer()) :: &lt;&lt;_::32&gt;&gt;
```

Convert a 32-bit integer to binary bytes in current byte order.

# `int32u_to_little_endian`

```elixir
@spec int32u_to_little_endian(integer()) :: &lt;&lt;_::32&gt;&gt;
```

Convert a 32-bit integer to little-endian binary bytes.

# `little_endian_to_integer`

```elixir
@spec little_endian_to_integer(binary()) :: non_neg_integer()
```

Convert little-endian binary bytes to integer.

# `little_endian_to_signed`

```elixir
@spec little_endian_to_signed(&lt;&lt;_::32&gt;&gt;) :: integer()
```

# `optionally_create_ets_table`

```elixir
@spec optionally_create_ets_table() :: :ok
```

# `rational_to_current`

```elixir
@spec rational_to_current(rational() | [rational()]) :: binary() | [binary()]
@spec rational_to_current(signed_rational() | [signed_rational()]) ::
  binary() | [binary()]
```

# `reverse`

```elixir
@spec reverse(binary()) :: binary()
```

Reverse the given binary bytes

# `set_byte_order`

```elixir
@spec set_byte_order(:big | :little) :: true
```

# `signed_rational_to_current`

# `to_integer`

```elixir
@spec to_integer(binary()) :: non_neg_integer()
```

Convert binary bytes to decimal based on endianness.

# `to_rational`

```elixir
@spec to_rational(binary()) :: rational() | [rational()]
```

When given 8 bytes, returns a single {numerator, denominator} tuple.
When given multiples of 8 bytes, returns a list of those tuples.

# `to_signed`

```elixir
@spec to_signed(&lt;&lt;_::32&gt;&gt;) :: integer()
```

# `to_signed_rational`

```elixir
@spec to_signed_rational(binary()) :: signed_rational() | [signed_rational()]
```

When given 8 bytes, returns a single {numerator, denominator} tuple.
When given multiples of 8 bytes, returns a list of those tuples.

---

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