i’ve spent the past week with this lol, so many weird edgecases
lz4-lua
A pure Lua implementation of the LZ4 compression algorithm
LZ4 is a compression algorithm that uses dictionary-based matching to compress data. It compressess data into a block format.
This library attempts to work with the block format, and compress to it using a different algorithm (probably) to the C++ library. That being said, it should still work with the C++ tools and decompress C++ encoded data.
Source Code
Documentation
To compress a stream:
lz4.compress(data)
To decompress a stream:
lz4.decompress(data)
Notes
This library could definitely be more well optimised. Feel free to contribute optimisations on the GitHub, for whatever reason, data compressed with this may not work with the native decompressor