Xo is experimental. The source is now public on GitHub, or try Xo in your browser.
Menu · crc32

Docs

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.

Source: std/crc32.xo:8

Functions

checksum

fn checksum(data: Bytes, poly: Poly = Poly.Ieee) -> Int

The CRC-32 of data, 0 to 2^32 - 1 (Go’s ChecksumIEEE, and Checksum with MakeTable(Castagnoli)).

Source: std/crc32.xo:15

update

fn update(crc: Int, data: Bytes, poly: Poly = Poly.Ieee) -> Int

The 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).

Source: std/crc32.xo:19

↑ index