Adler-32
Mark Adler's fast 32-bit checksum used in the zlib format
Overview
Adler-32 is a 32-bit checksum designed by Mark Adler for the zlib compression format, specified in RFC 1950. It is faster to compute than CRC-32 in software but detects fewer errors, particularly on short inputs. It provides no security against a deliberate attacker.
Adler-32 keeps two 16-bit sums modulo 65521, the largest prime below 2^16. A is the sum of all bytes plus one, and B is the sum of all successive values of A. The checksum is B·65536 + A. Using a prime modulus improves error detection compared with the Fletcher checksum on which it is based.
For short messages, the sums do not grow large enough to wrap around the modulus, so many bits of the checksum are poorly used and error detection is weak. zlib uses Adler-32 because speed mattered more than strength for its purpose, and rsync uses a variant as a rolling checksum.
History
1995–1996Adler-32 written by Mark Adler for zlib
Specified in RFC 1950
Security notes
Adler-32 is not cryptographic and is easy to forge. It is also a relatively weak error-detecting code for inputs shorter than a few hundred bytes.
Typical uses
Variants in NextSSL
1| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| Adler32 adler32 |
standard | out 4 | RFC 1950 | safe |
Frequently asked questions
Which Adler-32 variants does NextSSL include?
NextSSL registers 1 Adler-32 variant: adler32.