const IEEE
pub const IEEE = 3988292384Purpose
Constant IEEE, defining protocol or algorithm parameters.
#hash/crc32IEEE/Castagnoli/Koopman CRC-32.
const IEEEpub const IEEE = 3988292384Constant IEEE, defining protocol or algorithm parameters.
const CASTAGNOLIpub const CASTAGNOLI = 2197175160Constant CASTAGNOLI, defining protocol or algorithm parameters.
const KOOPMANpub const KOOPMAN = 3945912366Constant KOOPMAN, defining protocol or algorithm parameters.
struct Tablepub struct Table {
pub entries [256]int
}Structure encapsulating entries.
entries [256]intmake_tablepub fn make_table(poly int) TableBuild 256-entry CRC lookup table from polynomial.
poly intTable — a value of this type
updatepub fn update(tab &Table, crc int, data &string) intExecute update.
tab &Tablecrc intdata &stringint — a value of this type
checksumpub fn checksum(data &string, tab &Table) intCompute the 32-bit checksum of the data.
data &stringtab &Tableint — a value of this type
struct Digestpub struct Digest {
pub tab Table
pub crc int
pub is_ieee bool
}Crc32 Cryptographic hash digest state context.
tab Tablecrc intis_ieee boolnew_ieeepub fn new_ieee() DigestConstruct ieee.
No arguments are required.
Digest — a value of this type
($&Digest) writepub fn (d $&Digest) write(p &string) intOperation on $&Digest: write data and return the byte count.
d $&DigestDigest instance used by this call (exclusive borrow).p &stringint — bytes written
(&Digest) sumpub fn (d &Digest) sum() intOperation on &Digest: compute a digest (often lowercase hex).
d &DigestDigest instance used by this call (borrow).int — a value of this type
(&Digest) sizepub fn (d &Digest) size() intOperation on &Digest: return the size.
d &DigestDigest instance used by this call (borrow).int — a value of this type
($&Digest) resetpub fn (d $&Digest) reset()Operation on $&Digest: clear internal state so the value can be reused.
d $&DigestDigest instance used by this call (exclusive borrow).This call does not return a value.
checksum_ieeepub fn checksum_ieee(data &string) intCompute CRC-32 checksum using IEEE polynomial.
data &stringint — a value of this type
checksum_castagnolipub fn checksum_castagnoli(data &string) intCompute CRC-32C checksum using Castagnoli polynomial.
data &stringint — a value of this type
checksum_koopmanpub fn checksum_koopman(data &string) intCompute CRC-32 checksum using Koopman polynomial.
data &stringint — a value of this type