Skip to main content

crc16

Function crc16 

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

Computes the CRC-16/CCITT-FALSE of a single byte slice.

§Arguments

  • data - the bytes to check.

§Returns

The 16-bit CRC.

§Examples

use pamoja_mesh::crc16;

// The standard CRC-16/CCITT-FALSE check value over the ASCII digits "123456789".
assert_eq!(crc16(b"123456789"), 0x29B1);