How does the deflate algorithm work?
Zip files use what is commonly called the deflate algorithm. Deflate normally uses LZSS compression with a 32K sliding window, with the output of the LZSS compressor further compressed via a pair of Huffman coders. The most comprehensible public source for the deflate algorithm is in the freely available zlib package. The zlib source and more info lives at: http://www.cdrom.com/pub/infozip/zlib/ To learn about the details of the format, you can get a pretty coherent explanation from RFC 1951. To learn about how the algorithms (LZSS and Huffman coding) actually work, please buy a copy of my book, “The Data Compression Book, 2nd Edition.”, ISBN 1-55851-434-1, M&T Books, available at most good bookstores. To get more info on the book (including a link to order the book from Amazon.com) go to my home page and follow the links to “The Data Compression Book”: http://www.dogma.