Algorithms

Adler-32

Two running sums modulo 65521. The four bytes at the end of every zlib stream
IDadler3236 / 46Adler · 32-bit
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

encodingstring
default hex
Output encoding: hex, base64, base64url, binary
roundsnumber
default 1
How many times to hash, each round hashing the previous digest
chainstring
default bytes
What each round after the first hashes: bytes of the digest, or its lowercase hex

Access

Createcreate("adler32")
CLIhashes 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.

ts
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.