Skip to main content

crc32

Function crc32 

Source
pub fn crc32(bytes: &[u8]) -> u32
Expand description

CRC-32/ISO-HDLC of bytes, the checksum of zlib, PNG and Ethernet.

Parameters: polynomial 0x04C11DB7 (reflected 0xEDB88320), initial value and final XOR 0xFFFFFFFF, input and output reflected. Check value: crc32(b"123456789") == 0xCBF4_3926. Detects every error burst of up to 32 bits, in particular every single-bit error.

ยงExamples

use temporal_control::dispatch::encoding::crc32;

assert_eq!(crc32(b"123456789"), 0xCBF4_3926);
assert_eq!(crc32(b""), 0);