# `MAVLink2.CRC`
[🔗](https://github.com/isaiahdw/mavlink2/blob/v0.1.0/lib/mavlink2/crc.ex#L1)

MAVLink's checksum: CRC-16/MCRF4XX, also called the X.25 CRC, as
MAVLink's `crc_accumulate` computes it (seed `0xFFFF`).

# `accumulate`

```elixir
@spec accumulate(0..65535, 0..255) :: 0..65535
```

Fold one byte into `crc`.

Separate from `accumulate_bytes/2` because a frame's checksum runs over
the header and payload and then over the message's `crc_extra`, which is
not contiguous with either.

# `accumulate_bytes`

```elixir
@spec accumulate_bytes(0..65535, binary()) :: 0..65535
```

Fold every byte of `bin` into `crc`.

# `checksum`

```elixir
@spec checksum(binary(), 0..255) :: 0..65535
```

The frame checksum over `bin`, finished with `crc_extra`.

`crc_extra` is the per-message byte from the dialect: two peers with
different definitions of a message fail the checksum instead of misreading
its fields.

# `seed`

```elixir
@spec seed() :: 0..65535
```

The initial accumulator value, `0xFFFF`.

---

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