v0.0.2
This release replaces the previous C-based implementation with a native Zig implementation of Zstandard.
The implementation targets Zstandard 1.6.0 and Zig 0.16.0, with the codec and supporting functionality organized into dedicated Zig modules.
Highlights
- Complete native Zig implementation of Zstandard
- No C or
libzstddependency - Native compression and decompression
- Zstandard frame and block handling
- Raw, RLE, and compressed block support
- Huffman and FSE entropy coding
- Native bitstream implementation
- xxHash checksum support
- Streaming compression and decompression
- Compression and decompression contexts
- Dictionary support
- COVER and FastCover dictionary building
- Legacy Zstandard v0.1–v0.7 detection and support
- Redesigned public API
- Updated examples, tests, CI, and documentation
Format Support
The implementation covers the core Zstandard format, including frame headers, content sizes, window descriptors, dictionary IDs, checksums, skippable frames, block headers, block types, and frame boundaries.
Raw, RLE, and compressed blocks are handled through the native block codec, with Huffman and FSE support for entropy-coded data.
Streaming and Dictionaries
Native streaming support is provided through compression and decompression streams and reusable contexts.
Dictionary functionality includes dictionary loading, dictionary IDs, dictionary compression/decompression, dictionary building, COVER, and FastCover.
Legacy frame detection for Zstandard v0.1 through v0.7 is also included.
API
The public API has been redesigned around:
src/zstd.zig
The public surface is separated from the internal implementation modules, which are organized under src/common, src/compress, src/decompress, src/frame, src/fse, src/huffman, src/streaming, src/dictionary, and src/legacy.
Zig 0.16
The project now targets Zig 0.16.0.
Examples and filesystem operations have been updated to use the Zig 0.16 std.Io API, including the new file compression example.
Verification
221/221 tests passed
23/23 build steps successful
12/12 examples passed
Zig → Python: 18/18 interoperability tests passed
Python → Zig raw frames: 7/7 interoperability tests passed
The interoperability tests cover raw and RLE data, different input sizes, Unicode data, frame handling, and checksummed frames.
Breaking Changes
The previous C-based implementation has been removed from the package build. zstd.zig is now built entirely from the native Zig implementation.
The minimum supported Zig version is 0.16.0, and consumers should use the redesigned API exposed through src/zstd.zig.
Documentation
The README, API reference, guides, examples, contribution documentation, and documentation site have been updated to reflect the new native implementation and project structure.