LZ4
LZ4 compression and decompression routines.
https://github.com/lz4/lz4/tree/dev/lib http://fastcompression.blogspot.fr/p/lz4.html
The high-compression option is a simpler version of the one of the original algorithm, and only retains a better hash table that remembers about more occurrences of a previous 4-bytes sequence, and removes all the logic about handling of the case when overlapping matches are found.
Types
Simple lossy HashTable that only stores the last occurrence for each hash on 2^14 bytes of memory.
A higher-precision HashTable. It stores up to 256 occurrences of 4-bytes sequences in the last 2^16 bytes, which makes it much more likely to find matches than [ ].
Properties
Functions
Compress bytes[off:off+len] into out using at most 16kB of memory. ht shouldn't be shared across threads but can safely be reused.
Compress bytes[dictOff+dictLen:dictOff+dictLen+len] into out using at most 16kB of memory. bytes[dictOff:dictOff+dictLen] will be used as a dictionary. dictLen must not be greater than 64kB, the maximum window size.
Decompress at least decompressedLen bytes into dest[dOff:]. Please note that dest must be large enough to be able to hold all decompressed data (meaning that you need to know the total decompressed length). If the given bytes were compressed using a preset dictionary then the same dictionary must be provided in dest[dOff-dictLen:dOff].