Zlib and gzip wrappers store a checksum of the uncompressed data. Recomputing and comparing it during decoding helps detect damage. Adler and CRC accumulate this information in a small state and continue across buffers.
Locate this topic on the global map ↗The first 2 chapters explain algorithms, data layouts, and optimizations. The final chapter connects the proof argument. Read in order or enter from a familiar stage.
- 01IMPLEMENTATION DETAIL↗
Adler-32 recurrence and batching
Check a byte sequence with two running sums, then understand batching and combination.
- 02IMPLEMENTATION DETAIL↗
CRC-32 bits and table lookup
Understand CRC one bit at a time, then see how tables reduce repeated work.
- 03PROOF ARGUMENT↗
The checksum proof argument
Explain why optimized implementations compute the same checksum and read only admitted input.