#decompression #ffi #lz

sys lz-decompress

Rust bindings to lzlib for decompressing .lz files

3 unstable releases

new 0.2.1 May 7, 2025
0.2.0 May 7, 2025
0.1.0 May 6, 2025

#261 in Compression

Download history 68/week @ 2025-04-30

68 downloads per month

BSD-2-Clause

185KB
4.5K SLoC

C 4K SLoC // 0.1% comments Shell 448 SLoC // 0.0% comments Rust 44 SLoC

Contains (autotools obfuscated code, 9KB) lzlib-src/configure

lz-decompress

Rust bindings for the lzlib compression library — providing decompression support for .lz files.

This crate offers a safe Rust interface to a subset of lzlib, exposing a function to decompress .lz files.

Features

  • Decompress .lz files using lzlib
  • Simple, safe Rust API
  • tested with integration tests

Usage

use std::path::Path;
use lzlib_rs::decompress_file;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let input = Path::new("test.txt.lz");
    let output = Path::new("test.txt");

    decompress_file(input, output)?;

    println!("Decompressed to {}", output.display());
    Ok(())
}

License

This crate is distributed under the terms of the 2-clause BSD license, the same as the upstream lzlib C library.

See LICENSE.txt for full text. Original C code copyright © Antonio Diaz Diaz.

Dependencies

~0.4–315KB