#decompress #lzx #lzxd #xnb

lzxd

Decompression implementation for Microsoft’s LZXD compression format

5 releases

0.1.4 Oct 10, 2021
0.1.3 Oct 7, 2021
0.1.2 Sep 22, 2021
0.1.1 Sep 11, 2021
0.1.0 Jul 13, 2020

#42 in Compression

Download history 2/week @ 2021-07-20 2/week @ 2021-07-27 2/week @ 2021-08-03 5/week @ 2021-08-10 10/week @ 2021-08-31 37/week @ 2021-09-07 3/week @ 2021-09-14 132/week @ 2021-09-21 42/week @ 2021-09-28 126/week @ 2021-10-05 89/week @ 2021-10-12 45/week @ 2021-10-19

111 downloads per month
Used in 2 crates (via cab)

MIT/Apache

67KB
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