#decompression #xnb #lzx

lzxd

Decompression implementation for Microsoft's LZXD compression format

11 releases

0.2.5 Dec 27, 2023
0.2.4 Dec 26, 2023
0.2.1 Nov 21, 2023
0.1.4 Oct 10, 2021
0.1.0 Jul 13, 2020

#74 in Compression

Download history 5871/week @ 2024-01-01 6534/week @ 2024-01-08 7577/week @ 2024-01-15 7353/week @ 2024-01-22 7889/week @ 2024-01-29 8154/week @ 2024-02-05 5738/week @ 2024-02-12 9221/week @ 2024-02-19 16907/week @ 2024-02-26 24104/week @ 2024-03-04 21838/week @ 2024-03-11 22550/week @ 2024-03-18 8550/week @ 2024-03-25 10333/week @ 2024-04-01 8964/week @ 2024-04-08 8860/week @ 2024-04-15

37,649 downloads per month
Used in 27 crates (via cab)

MIT/Apache

69KB
1K SLoC

lzxd

A Rust implementation of Microsoft's lzxd encoding, based in the description and code of the document itself. This crate currently only implements decompression.

use lzxd::{Lzxd, WindowSize};

let mut lzxd = Lzxd::new(WindowSize::KB64);

while let Some(chunk) = get_compressed_chunk() {
    let decompressed = lzxd.decompress_next(&chunk);
    write_data(decompressed.unwrap());
}

The project's motivation was to be able to read XNB files produced by XNA Game Studio, some of which are compressed under LZXD compression.

Huge thanks to LeonBlade for their xnbcli project which helped greatly to debug this implementation, and special mention to dorkbox's CabParser for further helping validate that this implementation is able to decompress real-world data correctly.

License

This library is licensed under either of

at your option.

No runtime deps