checksums
nimony/lib/std/compress/checksums.nim
type Crc32 = distinct uint32A running CRC-32. Kept inverted between updates, as the algorithm wants it;
finishundoes that. Distinct so a running value cannot be compared against a finished one by accident — they differ in every bit.proc initCrc32(): Crc32proc update(c: Crc32; data: openArray[char]): Crc32proc finish(c: Crc32): uint32proc crc32(data: openArray[char]): uint32The CRC-32 of
datain one call.type Adler32 = distinct uint32A running Adler-32: the two 16-bit sums packed as
b shl 16 or a, which is also the finished value — there is no final step.proc initAdler32(): Adler32proc update(c: Adler32; data: openArray[char]): Adler32proc finish(c: Adler32): uint32proc adler32(data: openArray[char]): uint32The Adler-32 of
datain one call.