# `ExWapp.AppState.LTHash`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/appstate/lthash.ex#L2)

Linked-list Truncated Hash for WhatsApp App State integrity verification.

Maintains a 128-byte hash that tracks the state of all applied mutations
via pointwise u16 little-endian arithmetic with wrapping.

Matches whatsmeow `appstate/lthash/lthash.go`.

# `add`

```elixir
@spec add(binary(), [binary()]) :: binary()
```

Add MACs to the hash state.

# `new`

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

Create a new empty LTHash (128 zero bytes).

# `subtract`

```elixir
@spec subtract(binary(), [binary()]) :: binary()
```

Subtract MACs from the hash state.

# `subtract_then_add`

```elixir
@spec subtract_then_add(binary(), [binary()], [binary()]) :: binary()
```

Subtract old MACs then add new MACs to the hash state.

Returns updated 128-byte hash.

Matches whatsmeow `LTHash.SubtractThenAdd()`.

---

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