Skip to main content

crc16_mcrf4xx

Function crc16_mcrf4xx 

Source
pub const fn crc16_mcrf4xx(data: &[u8]) -> u16
Expand description

Computes the CRC-16/MCRF4XX of a byte slice.

The parameters are width 16, polynomial 0x1021, initial value 0xFFFF, input and output reflected, and no final inversion (xorout = 0x0000). True CRC-16/X-25 differs only in that final inversion, so this checks 0x6F91 over "123456789" where X-25 checks 0x906E.

§Arguments

  • data - the bytes to check.

§Returns

The 16-bit CRC.

§Examples

use pamoja_mavlink::crc16_mcrf4xx;

// The catalogue check value for CRC-16/MCRF4XX.
assert_eq!(crc16_mcrf4xx(b"123456789"), 0x6F91);