hn.today

Show HN: Deflate X-Ray, See inside a compressed file

hrih.si3 points0 comments
Screenshot of Show HN: Deflate X-Ray, See inside a compressed file

Deflate X-Ray is a browser-based tool for inspecting how DEFLATE compression represents data, the method used by formats including ZIP, PNG, gzip, zlib, and much web content. Rather than showing only the decompressed result, it visualizes where each byte came from and how many bits it took to encode. Repeated text appears as a pointer to an earlier sequence; selecting a byte reveals that pointer, its underlying bits, and an arc linking the copy to its origin. Color indicates storage cost, making frequent, inexpensive repeats visually distinct from costly characters. The viewer also reports how bits are divided among content, pointers, and headers, and checks the file’s checksum.

Users can enter text to see how the browser’s own compressor encodes it, or open supported files directly in the page. Files are never uploaded: the tool runs locally and makes no network requests. Its decompressor is written from scratch, follows RFC 1951, handles all three DEFLATE block types, and locates streams inside several common file formats. Examples show how repeated verses in “The House That Jack Built” build on prior copies over 11 generations, while a PNG gradient reaches 150. The visualization covers up to 150,000 stream bytes, though its statistics cover the full stream. It traces only the first member of multi-member gzip files and does not support ZIP64, encrypted ZIP entries, or preset zlib dictionaries; non-ASCII bytes display as dots.

Read on hrih.si0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.