Algorithms
Adler-32
Two running sums modulo 65521. The four bytes at the end of every zlib stream
Hash / Non-cryptographic
Adler-32
Two sums mod 65521 that close a zlib stream.
- Digest
- 32-bit · 4 bytes
- HMAC
- no key mode
- Security
- NOT for security: weaker than CRC-32 on short inputs
- Family
- 1 in Adler
3 options, 0 required
Sample
- hex
- 1a0b045d
- base64
- GgsEXQ==
Options
Access
- Create
create("adler32") - CLI
hashes adler32 'hello world' - Tryplayground with the sample above
Mark Adler's checksum from RFC 1950. One sum of the bytes plus one, one sum of those sums, both modulo the largest prime below 2^16. Cheaper than a CRC and weaker on short inputs, where the first sum never gets near the modulus.
create("adler32").hash("Wikipedia").digest; // "11e60398"
create("adler32").hash("").digest; // "00000001", the empty input starts at one
zlib writes it big-endian after the deflate data, so the last four bytes of a zlib stream are exactly this digest of what it decompresses to.