Package-level declarations

Types

Link copied to clipboard

Adler-32 (RFC 1950): the zlib-stream trailer checksum. Two 16-bit rolling sums modulo 65521, combined as (b shl 16) or a. Faster but weaker than CRC-32.

Link copied to clipboard
interface Checksum

A streaming, unkeyed integrity check (CRC / Adler family). All implementations are pure-Kotlin and table-driven. They are cheap (GB/s), export-safe, and need no constant-time care, so the core module can hold them. AES is different: this design delegates it to a platform crypto provider.

Link copied to clipboard
class Crc32 : Checksum

CRC-32 (IEEE 802.3 / zlib / gzip / PNG): reflected polynomial 0xEDB88320, init 0xFFFFFFFF, final XOR 0xFFFFFFFF. Matches zlib's crc32().

Link copied to clipboard

CRC-32C (Castagnoli): reflected polynomial 0x82F63B78, init 0xFFFFFFFF, final XOR 0xFFFFFFFF. Used by btrfs/ext4/iSCSI/SCTP and as an optional 7z check (NOT by ZIP, which uses Crc32).

Link copied to clipboard
class Crc64 : Checksum

CRC-64/XZ (ECMA-182): reflected polynomial 0xC96C5795D7870F42, init 0xFFFFFFFFFFFFFFFF, final XOR 0xFFFFFFFFFFFFFFFF. This is the integrity check used by the .xz container (and an optional 7z check).

Link copied to clipboard
object XxHash32

xxHash32 (Yann Collet): the checksum used by the LZ4 frame format for its header (HC byte) and optional block/content checks. Pure-Kotlin, one-shot. 32-bit wrapping arithmetic done in Int; the result is exposed unsigned in the low 32 bits of a Long.