#lzma #wasm #xz

liblzma

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

21 releases

0.4.6 Feb 17, 2026
0.4.5 Sep 28, 2025
0.4.4 Aug 27, 2025
0.4.2 Jun 18, 2025
0.2.1 Oct 4, 2023

#36 in Compression

Download history 495602/week @ 2026-01-25 459765/week @ 2026-02-01 447144/week @ 2026-02-08 421879/week @ 2026-02-15 452246/week @ 2026-02-22 550158/week @ 2026-03-01 588585/week @ 2026-03-08 536953/week @ 2026-03-15 326683/week @ 2026-03-22 239256/week @ 2026-03-29 225723/week @ 2026-04-05 253282/week @ 2026-04-12 252037/week @ 2026-04-19 250920/week @ 2026-04-26 284045/week @ 2026-05-03 335113/week @ 2026-05-10

1,141,118 downloads per month
Used in 457 crates (71 directly)

MIT/Apache

5.5MB
62K SLoC

PO File 28K SLoC // 0.5% comments C 26K SLoC // 0.3% comments Rust 4K SLoC // 0.0% comments M4 782 SLoC // 0.4% comments Automake 671 SLoC // 0.1% comments Shell 666 SLoC // 0.3% comments BASH 459 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