A Lua library providing a functional, streaming interface to zlib for compression and decompression.
lua-zlib is a Lua binding for the zlib compression library that provides a functional, streaming interface for compressing and decompressing data. It solves the problem of efficiently handling large or continuous data streams in Lua applications by allowing incremental processing without requiring full data loading into memory.
Lua developers working with data compression, network protocols, file I/O, or serialization who need efficient streaming compression/decompression capabilities.
Developers choose lua-zlib for its simple, streaming API that mirrors zlib's functionality closely, offering fine-grained control over compression parameters and memory usage while being lightweight and compatible with existing Lua ecosystems.
Simple streaming interface to zlib for Lua.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides deflate and inflate functions that process data in chunks, enabling handling of large streams without full memory loading, as demonstrated in the concatenated stream example.
Allows adjustment of compression levels (1-9), window sizes, and flush options like sync, full, and finish, giving fine-grained control over performance and output.
Offers adler32 and crc32 checksum factories that can be updated incrementally, useful for verifying data integrity in pipelines, with examples for all-in-one or multi-call usage.
Correctly inflates multiple concatenated gzip files by managing EOF and byte counts, as shown in the README example with seek and shift handling.
Requires zlib to be installed separately, which complicates deployment on platforms without easy package management or in restricted environments.
The API demands careful handling of flush options and EOF states; errors like calling stream after finish lead to IllegalState errors without built-in safeguards, increasing debugging effort.
The shim for lzlib has incompatibilities, such as version() returning a numeric tuple instead of a string and checksum functions behaving differently, which can break drop-in replacement attempts.