zlib is a lossless data compression library that implements the deflate compression algorithm, combining LZ77 sliding window and Huffman coding. It provides the core compression and decompression engines, along with support for gzip, zlib, and raw deflate stream formats, enabling data to be compressed and restored without any loss of information.
The library offers a range of capabilities for handling compressed data, including single-call memory and file operations, as well as incremental stream-based processing for working with data larger than available memory. It includes mechanisms for aborting compression or decompression mid-process through a user-set flag, and provides callback-based progress reporting for user feedback and cancellation. For data integrity, zlib computes Adler-32 and CRC-32 checksums, and includes tools for generating custom CRC algorithms and manipulating CRC values.
Beyond compression, the library handles zip archives through its minizip contribution, supporting creation, extraction, and merging of zip files with multiple compression methods including deflate64 and bzip2, as well as Zip64 for large archives. The library is designed to work across different platforms, exchanging compressed data between systems with different byte orders and 64-bit architectures.