#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

#63 in Compression

Download history 9509/week @ 2024-06-09 8733/week @ 2024-06-16 10485/week @ 2024-06-23 8685/week @ 2024-06-30 11042/week @ 2024-07-07 12537/week @ 2024-07-14 16656/week @ 2024-07-21 16227/week @ 2024-07-28 15875/week @ 2024-08-04 16479/week @ 2024-08-11 20350/week @ 2024-08-18 18326/week @ 2024-08-25 20474/week @ 2024-09-01 20413/week @ 2024-09-08 16915/week @ 2024-09-15 19019/week @ 2024-09-22

77,960 downloads per month
Used in 30 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