SFLZ4 is a single file C library for the LZ4 block compression format.
It's about 500 lines of C code.
You can instead subset just the lz4.c
and lz4.h
files from the official
lz4 library, if you don't mind having
two files.
smalllz4 is another alternative.
Quoting from that LZ4 documentation link's "Metadata" section:
An LZ4-compressed Block requires additional metadata for proper decoding. Typically, a decoder will require the compressed block's size, and an upper bound of decompressed size.
TODO: have this library also implement the LZ4 frame format.
Apache 2. See the LICENSE file for details.
Updated on December 2022.