valmyzk / lzxd

Home Page:https://crates.io/crates/lzxd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

https://crates.io/crates/lzxd

License:Apache License 2.0


Languages

Language:Rust 100.0%