Stories
Slash Boxes
Comments

SoylentNews is people

Submission Preview

Link to Story

A Deep Dive into the History and Evolution of Zip Compression

Accepted submission by canopic jug at 2020-02-28 05:50:02
Software

Hans Wennborg does a deep dive into the history and evolution of the Zip compression format and underlying algorithms [hanshq.net] in a blog post. While this lossless compression format became popular around three decades ago, it has its roots in the 1950s and 1970s. Notably, as a result of the "Arc Wars" of the 1980s, hitting BBS users hard, the Zip format was dedicated to the public domain from the start. The main work of the Zip format is performed through use of Lempel-Ziv compression (LZ77) and Huffman coding.

I have been curious about data compression and the Zip file format in particular for a long time. At some point I decided to address that by learning how it works and writing my own Zip program. The implementation turned into an exciting programming exercise; there is great pleasure to be had from creating a well oiled machine that takes data apart, jumbles its bits into a more efficient representation, and puts it all back together again. Hopefully it is interesting to read about too.

This article explains how the Zip file format and its compression scheme work in great detail: LZ77 compression, Huffman coding, Deflate and all. It tells some of the history, and provides a reasonably efficient example implementation written from scratch in C. The source code is available in hwzip-1.0.zip [hanshq.net].

Earlier on SN:
Specially Crafted ZIP Files Used to Bypass Secure Email Gateways [soylentnews.org] (2019)
Which Compression Format to Use for Archiving? [soylentnews.org] (2019)
The Math Trick Behind MP3s, JPEGs, and Homer Simpson’s Face [soylentnews.org] (2019)
Ask Soylent: Internet-communication Archival System [soylentnews.org] (2014)


Original Submission