Hacker News new | ask | show | jobs
by crazygringo 738 days ago
Are there any command-line tools for zip or similar that allow you to predefine a dictionary over one or more files, and then use that dictionary to compress small files?

Which would require the dictionary as a separate input when decompressing, of course?

2 comments

zstd supports shared dictionaries easily.

It also has vastly superior compression and performance, compared to gzip, even without.

gzip (or really DEFLATE) does actually come with a small predefined dictionary (the "fixed Huffman codes" in the RFC) which is somewhat optimised for latin letters in UTF-8, but I have not verified that this is indeed what ends up being used when compressing individual lines of source code.