just_zstd 0.2.0 copy "just_zstd: ^0.2.0" to clipboard
just_zstd: ^0.2.0 copied to clipboard

A pure Dart implementation of the Zstandard (RFC 8878) decompression algorithm. Lightweight, dependency-free decoder for zstd compressed data.

Changelog #

0.2.0 - 2026-04-22 #

Added #

  • ZstdEncoder — Zstandard frame encoder producing raw (uncompressed) blocks.
    • encode(List<int>) and encodeBytes(Uint8List) for creating valid Zstandard frames.
    • Frame header generation: magic number, frame descriptor, content size, and block headers.
    • Raw block encoding for O(n) performance with minimal overhead.
    • Output is fully compatible with ZstdDecoder.

0.1.0 - 2026-03-15 #

Added #

  • ZstdDecoder — main decompressor implementing the Zstandard (RFC 8878) frame format.
    • decode(List<int>) and decodeBytes(Uint8List) for decompressing Zstandard frames.
    • Frame header parsing: magic number validation, frame descriptor, window size, optional dictionary ID and content checksum flags.
    • Three block types: raw (direct copy), RLE (run-length), and compressed (entropy-coded).
    • Skippable frame support (0x184D2A500x184D2A5F).
    • Descriptive FormatException on malformed input.
  • BitReader — LSB-first bit-level stream reader.
    • readBits(), readBit(), readByte(), readBytes(), readUint32LE(), readUint16LE().
    • Byte/bit position tracking, alignment helpers, and buffer-overrun guards.
  • FseTable / FseEntry — tANS (table-based Asymmetric Numeral Systems) entropy decoder.
    • FseTable.build() constructs a decoding table from a normalised probability distribution.
    • readNormalizedDistribution() reads the compressed distribution header from the bitstream.
    • Used for literal-length, match-length, and offset codes in compressed blocks.
  • HuffmanTable / HuffmanEntry — canonical Huffman decoder for the literals section.
    • HuffmanTable.fromWeights() builds the table from symbol weights.
    • readWeights() supports both FSE-compressed and direct weight header formats.
  • Pure Dart implementation — no dart:ffi, no native extensions, no external dependencies.
  • Unit tests for BitReader and ZstdDecoder error handling.
  • Example usage in example/just_zstd_example.dart.
0
likes
150
points
134
downloads

Documentation

API reference

Publisher

verified publisherjustunknown.com

Weekly Downloads

A pure Dart implementation of the Zstandard (RFC 8878) decompression algorithm. Lightweight, dependency-free decoder for zstd compressed data.

Repository (GitHub)
View/report issues
Contributing

License

BSD-3-Clause (license)

More

Packages that depend on just_zstd