This is hwzip 1.4 from https://www.hanshq.net/zip.html
Written by Hans Wennborg.

It is put in the public domain; see the LICENSE file for details.


To build it on a Unix-like system:

$ clang generate_tables.c && ./a.out > tables.c
$ clang -O3 -DNDEBUG -march=native -o hwzip crc32.c deflate.c huffman.c \
        hwzip.c lz77.c tables.c zip.c

To build it on Windows, in a Visual Studio Developer Command Prompt:

cl /TC generate_tables.c && generate_tables > tables.c
cl /O2 /DNDEBUG /MT /Fehwzip.exe /TC crc32.c deflate.c huffman.c hwzip.c
        lz77.c tables.c zip.c /link setargv.obj


For a very detailed description of how it works, see the URL above.


Version history:

2020-10-11      Version 1.4
                - Split the distance2dist table into two smaller tables,
                  reducing the hwzip binary size by 32 KB.
                - Always emit at least two non-zero dist codeword lengths for
                  Deflate blocks. This is to ensure compatibility with old zlib
                  versions and possibly other software.

2020-06-14      Version 1.3
                - Changed the minimum LZ77 backref length from 3 to 4 bytes, and
                  switched from a rolling hash to hashing 4 bytes at a time.
                  This made Deflate compression more than twice as fast on my
                  machine.

2020-05-01      Version 1.2
                - Removed use of %zu" from printfs in generate_tables.c, as that
                  would lead to generating a broken tables.c file on systems
                  where libc doesn't support the "z" length modifier.
                - Removed call to hwdeflate with NULL src argument in
                  deflate_test.c; even with zero src_len it is not valid.
                - Fixed -Wshorten-64-to-32 and -Wsign-compare warnings in 32-bit
                  builds.
                - Disabled -Wc99-extensions (new warning in Clang 10) in the
                  Makefile.

2020-03-04      Version 1.1
                Fixed -Wextra-semi-stmt warnings reported by Horst von Brand.
                Also removed -Werror from the Makefile by default.

2020-02-25      Version 1.0
                Initial release.
