A walkthrough of implementing a gzip decompressor from scratch in ~250 lines of Rust. Covers the gzip file format structure, DEFLATE block types, bit-level reading, canonical Huffman coding, fixed vs dynamic Huffman tables, and LZ77 back-references including forward references. The implementation intentionally omits checksums
Table of contents
why bother?the gzip wrapperDEFLATE blocksreading bitshuffman codingfixed vs dynamic codesLZ77: back-referencesforward referencesputting it togetherwhat i learnedSort: