Skip to content

v0.0.2

Choose a tag to compare

@muhammad-fiaz muhammad-fiaz released this 23 Aug 15:34
· 1 commit to main since this release

This release introduces a complete native Zig reimplementation of Brotli, replacing the previous C-based implementation with a self-contained, dependency-free codec targeting Zig 0.16.0.

Highlights

  • Full native Brotli encoder and decoder based on RFC 7932
  • Large Window Brotli decoding support up to 30-bit windows
  • No C bindings, libc, or external dependencies
  • Native streaming compression and decompression
  • Static RFC 7932 dictionary embedded in Zig
  • Custom dictionary support
  • Quality levels 0–11
  • Window bits 10–24
  • Generic, text, and font compression modes
  • Typed decoder error codes
  • Fuzz-tested decoder
  • Comprehensive round-trip and streaming tests

Encoder

  • Hash-chain match finding
  • Greedy and lazy matching
  • Recent-distance shortcuts
  • Native Huffman table construction
  • Simple and complex Huffman trees
  • Length-limited Huffman coding
  • Compressed and stored metablocks
  • Insert-and-copy command generation
  • Explicit and implicit distance forms
  • Streaming progress callbacks

Decoder

  • Full streaming state machine
  • Metablocks and metadata blocks
  • Uncompressed metablocks
  • Context maps with RLE and inverse move-to-front transforms
  • Block type and length switching
  • Distance ring buffer
  • Compound dictionaries
  • Static dictionary transforms
  • Incremental input/output resumption
  • Robust malformed-stream handling

API

New native APIs include:

  • compress / compressWithOptions
  • decompress / decompressWithOptions
  • decompressInto
  • maxCompressedSize
  • Encoder and Decoder
  • StreamingCompressor
  • StreamingDecompressor
  • Encoder parameter configuration
  • Dictionary attachment
  • Output draining and completion queries

Documentation & Examples

Added a complete VitePress documentation site and standalone examples covering compression, decompression, streaming, dictionaries, progress callbacks, error handling, format introspection, and low-level bit operations.

Testing & CI

  • Comprehensive compression/decompression round trips
  • Multiple qualities, window sizes, and data patterns
  • Streaming and flush validation
  • Dictionary round-trip tests
  • Reference-stream verification
  • Malformed input testing
  • Decoder fuzzing
  • Linux, Windows, and macOS CI
  • x86, x86_64, and aarch64 cross-compilation

Requires Zig 0.16.0 or newer.