2 releases (1 stable)
Uses new Rust 2021
|1.0.0||Jan 2, 2022|
|0.1.0||Nov 14, 2021|
#129 in Compression
24 downloads per month
A rust crate for compressing and decompressing data in the RefPack format utilized by many EA games of the early 2000s
More details on the refpack format can be found at the niotso wiki. The short explanation is that RefPack is a compression scheme loosely based on LZ77 compression.
The Original Refpack Implementation was referenced to ensure proper compatibility
refpack-rs exposes two functions:
decompress, along with
with easier but less flexible of usage.
decompress take mutable references to a buffer to read and write from,
decompress will read from the buffer until it encounters a stopcode (byte within (0xFC..=0xFF)),
compress will read in the provided length.
let mut out_buf = Cursor::new(vec!); decompress(&mut source_reader, &mut out_buf)?;
The easy variants are
decompress_easy, which take a
&[u8] and return
Internally they simply call
decompress with a
Cursor to the input and
output buffers, however they are more convenient to use in many cases.