Skip to main content

crc8

Function crc8 

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

Dallas/Maxim 1-Wire CRC-8 (polynomial X^8 + X^5 + X^4 + 1, reflected 0x8C).

Used to validate ROM addresses (byte 7 covers bytes 0..7) and DS18B20 scratchpad reads (byte 8 covers bytes 0..8). A correct frame CRCs to 0 when the trailing CRC byte is included; this helper returns the CRC of data, so callers compare it against the received CRC byte. See Maxim app note 27.