#1801·lz4

Request: Add dart_lz4 Dart binding to the LZ4 bindings list

Author: jxoesneonCreated Sep 13, 2026Updated Sep 13, 2026

Request: Add dart_lz4 Dart binding to the LZ4 bindings list

The LZ4 website lists language bindings for various platforms. Currently, the only Dart binding listed is es_compression, which uses FFI/native code and does not support Web targets.

I'd like to request adding dart_lz4 — a pure Dart LZ4 implementation that complements es_compression by providing Web-safe, dependency-free LZ4 compression.

Package details

Features

  • Pure Dart implementation (no FFI, no native code)
  • Web-safe (no dart:io in library code, works on WASM)
  • LZ4 block encode/decode
  • LZ4 frame encode/decode (current format, legacy format, skippable frames)
  • LZ4HC high-compression mode (levels 1-12)
  • Streaming frame encode/decode via StreamTransformer
  • Dictionary support (encode + decode)
  • 64-bit content size support
  • xxHash32 with VM + Web parity
  • Zero-copy decompression API
  • Buffer pool architecture for zero-allocation streaming
  • dart:convert Codec wrapper for ecosystem composition

Interoperability

Tested against the reference lz4 CLI (lz4 v1.10.0) via embedded decode vectors and CLI decode tests. Produces valid LZ4 frames that the reference CLI can decode.

Differentiation from es_compression

Feature dart_lz4 es_compression
Pure Dart Yes No (FFI)
Web support Yes No
WASM Yes No
Runtime deps 0 Native LZ4
Frame format Current + legacy + skippable Current
HC mode Yes (levels 1-12) No
Streaming Yes (StreamTransformer) Limited

Why list it?

dart_lz4 fills the gap for Dart developers who need LZ4 compression on Web/WASM targets where FFI is unavailable. It is feature-complete, security-hardened (OpenSSF Gold, fuzzing, bounds-safe decoding), and interoperable with the reference implementation.

Thank you for considering this request.