# `Parrhesia.Negentropy.Message`

NIP-77 negentropy message codec and helpers.

# `bound`

```elixir
@type bound() :: :infinity | {non_neg_integer(), binary()}
```

# `item`

```elixir
@type item() :: %{created_at: non_neg_integer(), id: binary()}
```

# `range`

```elixir
@type range() :: %{
  upper_bound: bound(),
  mode: :skip | :fingerprint | :id_list,
  payload: nil | binary() | [binary()]
}
```

# `compare_bound`

```elixir
@spec compare_bound(bound(), bound()) :: :lt | :eq | :gt
```

# `compare_items`

```elixir
@spec compare_items(item(), item()) :: :lt | :eq | :gt
```

# `decode`

```elixir
@spec decode(binary()) ::
  {:ok, [range()]} | {:unsupported_version, byte()} | {:error, term()}
```

# `encode`

```elixir
@spec encode([range()]) :: binary()
```

# `fingerprint`

```elixir
@spec fingerprint([item()]) :: binary()
```

# `initial_lower_bound`

```elixir
@spec initial_lower_bound() :: bound()
```

# `item_in_range?`

```elixir
@spec item_in_range?(item(), bound(), bound()) :: boolean()
```

# `protocol_version`

```elixir
@spec protocol_version() :: byte()
```

# `split_bound`

```elixir
@spec split_bound(item(), item()) :: bound()
```

# `supported_version_message`

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

# `zero_id`

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

---

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