# deflate

> deflate, a magmalake tin: DEFLATE (RFC 1951) and gzip (RFC 1952) in pure Mojo, the compression inside Avro's deflate codec and Parquet's GZIP codec.

[magmalake](https://magmalake.dev/) [deflate](https://magmalake.dev/s/deflate)

DEFLATE (RFC 1951) and gzip (RFC 1952) in pure Mojo, the compression inside Avro's deflate codec and Parquet's GZIP codec. No FFI, no libz.

Install

```
pixi shelf add deflate-mojo
```

Version

`0.1.3` on mojoshelf

Source

[GitHub](https://github.com/magmalake/deflate.mojo) [README](https://github.com/magmalake/deflate.mojo#readme)

## Works today

- inflate for stored, fixed- and dynamic-Huffman blocks
- deflate with a hash-chain LZ77 matcher, fixed-Huffman blocks
- inflate\_at for back-to-back streams, as gzip members are
- gunzip for a whole .gz file: every member, header flags, each member's CRC-32 and size checked; gzip to write one

Checked against zlib: inflates what zlib wrote, one fixture per block type

- [thrift](https://magmalake.dev/s/thrift) compact + binary protocol
- [zstd](https://magmalake.dev/s/zstd) libzstd
- [lz4](https://magmalake.dev/s/lz4) liblz4
- [brotli](https://magmalake.dev/s/brotli) libbrotli
- [snappy](https://magmalake.dev/s/snappy) pure Mojo
- [hashes](https://magmalake.dev/s/hashes) CRC-32 · murmur3 · XXH64
- [memory-region](https://magmalake.dev/s/memory-region) bytes addressed by offset · shared mappings
- [threads](https://magmalake.dev/s/threads) pthreads · atomics · parallel\_for
- [Every tin](https://magmalake.dev/tins)

[A magmalake project](https://magmalake.dev/)

Apache 2.0 · © 2026 Marius Seritan
