std/checksum
CRC-32 (IEEE, the one gzip, PNG and zip use) and Adler-32 (zlib). The CRC is computed bitwise with no lookup table: constant work per byte, which suits worst-case-time analysis and small bare-metal targets. Values are returned as i64 held to 32 bits.
milo
from "std/checksum" import { Checksum }Example
milo
print(Checksum.crc32("hello")) // 907060870
print(Checksum.adler32("hello")) // 103547413API reference
Checksum
milo
pub struct ChecksumChecksum namespace — Checksum.crc32(data), Checksum.adler32(data).
Checksum.adler32
milo
fn Checksum.adler32(data: &string): i64Checksum.crc32
milo
fn Checksum.crc32(data: &string): i64