std/crc32
On this page
Index
Types
Poly
enum Poly {
Ieee
Castagnoli
}The polynomial: Go’s IEEE (0xedb88320) and Castagnoli (0x82f63b78) tables, both reversed as Go’s are.
Functions
checksum
fn checksum(data: Bytes, poly: Poly = Poly.Ieee) -> IntThe CRC-32 of data, 0 to 2^32 - 1 (Go’s ChecksumIEEE, and Checksum with MakeTable(Castagnoli)).
update
fn update(crc: Int, data: Bytes, poly: Poly = Poly.Ieee) -> IntThe CRC-32 of what crc was the checksum of, followed by data (Go’s
Update): update(checksum(a), b) == checksum(a + b), and
update(0, d) == checksum(d).