aivdm 0.3.0

no_std, no_alloc parser and encoder for AIS (ITU-R M.1371) messages over NMEA 0183
Documentation
1
2
3
4
5
6
7
8
//! NMEA 0183 XOR checksum.

/// Computes the NMEA XOR checksum over `body` (the sentence bytes between the
/// leading `!`/`$` and the trailing `*hh`, exclusive of both).
#[must_use]
pub fn compute(body: &[u8]) -> u8 {
    body.iter().fold(0u8, |acc, &b| acc ^ b)
}