# madler/zlib

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/madler-zlib).**

6,687 stars · 2,710 forks · C · other

## Links

- GitHub: https://github.com/madler/zlib
- Homepage: http://zlib.net/
- awesome-repositories: https://awesome-repositories.com/repository/madler-zlib.md

## Description

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.

## Tags

### Programming Languages & Runtimes

- [Data Compression and Decompression](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression.md) — Implements the deflate algorithm with LZ77 and Huffman coding for lossless compression and decompression.
- [Deflate Decompressors](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression/deflate-decompressors.md) — Reconstructs original data from a deflate-compressed stream, restoring it to its exact prior state. ([source](https://cdn.jsdelivr.net/gh/madler/zlib@develop/README.md))
- [Deflate Stream Decompression](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression/deflate-stream-decompression.md) — Provides the core inflate engine for decompressing deflate, gzip, and zlib streams. ([source](https://zlib.net/))
- [Gzip Decompression](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression/gzip-decompression.md) — Ships a stdio-like interface for reading and writing gzip-compressed files transparently.
- [Deflate Decompression](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression/gzip-decompression/deflate-decompression.md) — Provides the inflate decompression engine that restores deflate, zlib, and gzip streams.
- [Gzip File Read-Write Interfaces](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression/gzip-decompression/gzip-file-read-write-interfaces.md) — Provides a stdio-like interface for transparent reading and writing of gzip files.
- [Gzip File Read-Write Operations](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression/gzip-decompression/gzip-file-read-write-operations.md) — Provides a stdio-like interface for reading, writing, and appending gzip files. ([source](https://cdn.jsdelivr.net/gh/madler/zlib@develop/README.md))
- [Incremental Stream Processing](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression/incremental-stream-processing.md) — Processes data incrementally through repeated calls for compression or decompression of large data. ([source](http://zlib.net/manual.html))
- [Inflate Decompressors](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression/inflate-decompressors.md) — Decompresses data using the inflate algorithm, reading from an input buffer and writing to an output buffer. ([source](https://zlib.net/nelson/))
- [Inflate Stream Decompression](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression/inflate-stream-decompression.md) — Decompresses data incrementally by feeding compressed chunks through the inflate engine. ([source](https://zlib.net/zlib_faq.html))
- [Lossless Decompressors](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression/lossless-decompressors.md) — Restores data compressed with deflate, zlib, or gzip back to its original form without any loss. ([source](https://zlib.net/))
- [Single-Call File Decompression](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression/single-call-file-decompression.md) — Ships a convenience function for decompressing an entire file in one call. ([source](https://zlib.net/nelson/))

### Data & Databases

- [Deflate Compressors](https://awesome-repositories.com/f/data-databases/data-compression-algorithms/deflate-compressors.md) — Compresses data using the deflate algorithm, accepting input and output buffers for arbitrary streams. ([source](https://cdn.jsdelivr.net/gh/madler/zlib@develop/README.md))
- [In-Memory Compressors](https://awesome-repositories.com/f/data-databases/data-compression-algorithms/in-memory-compressors.md) — Compresses a block of data in a single call using the deflate algorithm, producing a compressed buffer. ([source](http://zlib.net/manual.html))
- [Lossless Compressors](https://awesome-repositories.com/f/data-databases/data-compression-algorithms/lossless-compressors.md) — Reduces data size losslessly using the deflate algorithm, outputting in zlib, gzip, or raw deflate format. ([source](https://zlib.net/))
- [Data Integrity Verification](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/data-storage/file-based-storage/local-file-storage/data-integrity-verification.md) — Provides Adler-32 and CRC-32 checksums for verifying data integrity during compression and decompression.
- [Zlib Compression Utilities](https://awesome-repositories.com/f/data-databases/data-serialization-formats/zlib-compression-utilities.md) — Processes data in the zlib format with header and checksum for compression and decompression. ([source](https://cdn.jsdelivr.net/gh/madler/zlib@develop/README.md))
- [Incremental Data Streaming](https://awesome-repositories.com/f/data-databases/incremental-data-streaming.md) — Processes data incrementally through memory buffers for compression or decompression without loading everything at once.
- [Streaming Compression Engines](https://awesome-repositories.com/f/data-databases/incremental-data-streaming/large-dataset-streaming/streaming-compression-engines.md) — Provides the core deflate compression engine using LZ77 and Huffman coding for lossless data reduction.
- [Caller-Supplied Buffer Streaming](https://awesome-repositories.com/f/data-databases/incremental-data-streaming/large-dataset-streaming/streaming-compression-engines/caller-supplied-buffer-streaming.md) — Processes data incrementally through caller-supplied memory buffers for compression or decompression.
- [Raw Deflate Stream Processing](https://awesome-repositories.com/f/data-databases/data-compression-algorithms/write-compression/raw-deflate-stream-processing.md) — Processes raw deflate streams without wrapper formats for custom containers or protocols. ([source](https://zlib.net/zlib_faq.html))
- [Large Data Volume Handling](https://awesome-repositories.com/f/data-databases/data-compression/large-data-volume-handling.md) — Supports processing data exceeding 4 GB without loss or corruption. ([source](https://zlib.net/zlib_faq.html))
- [Table-Driven CRC Algorithms](https://awesome-repositories.com/f/data-databases/row-wise-transformations/table-driven-crc-algorithms.md) — Calculates CRC values using bit-wise, byte-wise, or word-wise table-driven algorithms. ([source](https://zlib.net/))
- [Table-Driven CRC Computation](https://awesome-repositories.com/f/data-databases/row-wise-transformations/table-driven-crc-computation.md) — Calculates CRC values using bit-wise, byte-wise, or word-wise table-driven algorithms. ([source](https://zlib.net/))

### Operating Systems & Systems Programming

- [In-Memory Decompressors](https://awesome-repositories.com/f/operating-systems-systems-programming/in-memory-decompression-runtimes/in-memory-decompressors.md) — Decompresses a block of data in a single call using the inflate algorithm, restoring original content. ([source](http://zlib.net/manual.html))
- [CRC Lookup Tables](https://awesome-repositories.com/f/operating-systems-systems-programming/table-driven-decoding/crc-lookup-tables.md) — Implements table-driven CRC computation for data integrity verification during compression.
- [Adler-32 and CRC-32 Checksums](https://awesome-repositories.com/f/operating-systems-systems-programming/checksum-utilities/adler-32-and-crc-32-checksums.md) — Calculates Adler-32 or CRC-32 checksums and combines two checksums into one. ([source](http://zlib.net/manual.html))
- [Adler-32 Checksum Computation](https://awesome-repositories.com/f/operating-systems-systems-programming/checksum-utilities/data-integrity-checksums/adler-32-checksum-computation.md) — Computes Adler-32 checksums for data integrity during compression and decompression. ([source](https://zlib.net/zlib_faq.html))
- [CRC-32 Checksum Computation](https://awesome-repositories.com/f/operating-systems-systems-programming/checksum-utilities/data-integrity-checksums/crc-32-checksum-computation.md) — Computes CRC-32 checksums for widely compatible data integrity verification. ([source](https://zlib.net/zlib_faq.html))

### Scientific & Mathematical Computing

- [CRC Computation Libraries](https://awesome-repositories.com/f/scientific-mathematical-computing/high-performance-execution-environments/scientific-computing-platforms/computational-libraries/crc-computation-libraries.md) — Ships a dedicated CRC computation library with table-driven algorithms and custom CRC generation.

### Part of an Awesome List

- [Gzip File Writers](https://awesome-repositories.com/f/awesome-lists/devtools/file-compression/gzip-file-writers.md) — Writes compressed data directly to a gzip file, handling file I/O and compression in one operation. ([source](https://zlib.net/zlib_faq.html))
- [Single-Call File Compressors](https://awesome-repositories.com/f/awesome-lists/devtools/file-compression/single-call-file-compressors.md) — Compresses an entire file to another file using one function call with an optional compression level. ([source](https://zlib.net/nelson/))

### Development Tools & Productivity

- [Zip Compression Libraries](https://awesome-repositories.com/f/development-tools-productivity/developer-utilities-libraries/workflow-productivity-enhancers/developer-productivity-utilities/developer-utilities/file-resource-management/file-compression-utilities/zip-compression-libraries.md) — Reads and writes zip files with stored, deflate, deflate64, or bzip2 compression, including Zip64 support.
