#lzma #xz #api-bindings #wasm #encoding

liblzma

Rust bindings to liblzma providing Read/Write streams as well as low-level in-memory encoding/decoding. forked from xz2.

15 releases

new 0.4.0 Mar 27, 2025
0.3.5 Oct 28, 2024
0.3.3 Jul 30, 2024
0.3.0 Feb 26, 2024
0.2.1 Oct 4, 2023

#36 in Compression

Download history 6855/week @ 2024-12-06 6903/week @ 2024-12-13 4961/week @ 2024-12-20 5874/week @ 2024-12-27 9851/week @ 2025-01-03 8307/week @ 2025-01-10 7873/week @ 2025-01-17 9978/week @ 2025-01-24 9232/week @ 2025-01-31 10841/week @ 2025-02-07 7896/week @ 2025-02-14 10894/week @ 2025-02-21 12340/week @ 2025-02-28 11660/week @ 2025-03-07 13125/week @ 2025-03-14 10193/week @ 2025-03-21

48,937 downloads per month
Used in 48 crates (22 directly)

MIT/Apache

5MB
59K SLoC

C 26K SLoC // 0.3% comments PO File 26K SLoC // 0.5% comments Rust 4K SLoC // 0.0% comments M4 733 SLoC // 0.4% comments Automake 670 SLoC // 0.1% comments Shell 667 SLoC // 0.3% comments BASH 450 SLoC // 0.3% comments GNU Style Assembly 302 SLoC // 0.4% comments Bitbake 235 SLoC // 0.1% comments Batch 30 SLoC

liblzma

CI Crates.io

Documentation

Bindings to the liblzma implementation in Rust, also provides types to read/write xz streams.

This crate is forked from xz2 and liblzma = "0.1.x" is fully compatible with xz2 = "0.1.7", so you can migrate simply.

Migrate from xz2

# Cargo.toml
[dependencies]
-xz2 = "0.1.7"
+liblzma = "0.1.7"
// *.rs
-use xz2;
+use liblzma;

Version 0.2.x breaking changes

  • XZ upgraded to 5.4
  • Multithreading is disabled by default. This feature is available by enabling the parallel feature
  • Support for compiling to WebAssembly

Version 0.3.x breaking changes

  • XZ upgraded to 5.6

Version 0.4.x breaking changes

  • XZ upgraded to 5.8
  • Dropped tokio support (If you need async I/O, use async-compression crate with lzma feature flag)

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in liblzma by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies