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.

example/example.dart

import 'dart:typed_data';
import 'package:just_zstd/just_zstd.dart';

void main() {
  // The encoder and decoder are stateless and can be reused.
  const encoder = ZstdEncoder();
  const decoder = ZstdDecoder();

  // --- Encoding ---
  final original = Uint8List.fromList('Hello, Zstandard!'.codeUnits);

  print('Original:   ${original.length} bytes');

  // Encode to a valid Zstandard frame using raw blocks.
  final compressed = encoder.encodeBytes(original);

  print('Compressed: ${compressed.length} bytes');

  // --- Decoding ---
  try {
    final decompressed = decoder.decodeBytes(compressed);

    print('Decompressed: ${decompressed.length} bytes');
    print('Round-trip OK: ${String.fromCharCodes(decompressed)}');
  } on FormatException catch (e) {
    print('Error decoding data: $e');
  }
}
0
likes
150
points
133
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