Adler-32 Checksum
Calculate the Adler-32 checksum of UTF-8 text using the modulo-65521 rolling sums used by formats such as zlib.
Description
Calculate the Adler-32 checksum of UTF-8 text using the two modulo-65521 running sums defined for zlib.
Adler-32 is a fast non-cryptographic checksum. It maintains two 16-bit sums rather than performing polynomial division: one accumulates byte values and the other accumulates the first sum. The combined result is displayed as eight uppercase hexadecimal digits.1
When to use Adler-32 Checksum
Use Adler-32 when a zlib-related stream, protocol, file structure, or test vector explicitly calls for it. It is inexpensive to compute and is intended to reveal accidental corruption.
How Adler-32 Checksum works
How the Adler-32 function processes input
- Encode the entered text as UTF-8 bytes.
- Set s1 to 1 and s2 to 0.
- For each byte, update s1 = (s1 + byte) mod 65521 and s2 = (s2 + s1) mod 65521.
- Return s2 × 65536 + s1 as eight hexadecimal digits.
Limitations and assumptions
- Adler-32 is not cryptographic and an attacker can deliberately preserve or replace it.
- Short messages can exercise a relatively small portion of the checksum space.
- The tool checks UTF-8 bytes; checksumming an already compressed file requires a byte/file-oriented surface instead.
Alternative or Complementary approaches
Use CRC-32 when a format specifies CRC-32 or stronger accidental-error coverage is desired. Use SHA-256, HMAC, or a signature when adversarial changes are relevant.
References
-
Encoding Standard — WHATWG
-
RFC 1950: ZLIB Compressed Data Format Specification version 3.3 — RFC Editor
Similar or alternative tools
- CRC-32 Checksum
Calculate the common polynomial checksum.
- CRC-16/CCITT-FALSE Checksum
Calculate a parameterized 16-bit CRC.
- SHA-256 Hash Generator
Generate a cryptographic message digest.