Skip to main content

crc32c_append

Function crc32c_append 

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

Continues a CRC-32C (Castagnoli, polynomial 0x1EDC_6F41) checksum over bytes, seeded with the result of a prior call (seed 0 starts a fresh checksum).

This is a portable, table-driven software implementation provided so no_std layout crates can produce checksummed snapshot containers without a std-only CRC dependency. It satisfies the continuation law crc32c_append(crc32c_append(0, a), b) == crc32c_append(0, ab), matching the crc32c crate’s crc32c_append, and crc32c_append(0, b"") == 0. std consumers on hot write paths may prefer a hardware-accelerated implementation (e.g. the crc32c crate) — any continuation-style CRC-32C is byte-for-byte interchangeable with this one.

§Performance

This function is O(bytes.len()) (one table lookup per byte; no allocation).