Skip to main content

Crate lzma_sdk_rs

Crate lzma_sdk_rs 

Source
Expand description

§lzma-sdk-rs

A pure-Rust port of the 7-zip LZMA SDK 23.01 single-threaded LZMA encoder whose output is byte-identical to the C LzmaEnc_MemEncode(...) for the same input and properties.

The emitted stream is a raw LZMA stream: no 13-byte .lzma file header and no end-of-stream marker, exactly matching LzmaEnc_MemEncode called with writeEndMark = 0. The 5 decoder property bytes are produced separately by decoder_props (the equivalent of LzmaEnc_WriteProperties).

This crate is consumed by chd-rs and others that need to recreate the exact bytes 7-zip / MAME’s CHD codec would produce. See CLAUDE.md for the porting map, the bit-exactness hazards, and the differential-test rig.

§Status

encode is byte-exact with the C LzmaEnc_MemEncode across a broad corpus, verified out-of-tree against the C oracle (see docs/comparing-against-the-c-oracle.md). The match finder, optimal parser, decoder, and symbol layer are all complete. See ROADMAP.md.

Structs§

LzmaProps
Normalized LZMA encoder properties for the optimal-parser / BT4 path.

Functions§

decoder_props
The 5 decoder property bytes for props, identical to LzmaEnc_WriteProperties.
encode
Encode input into a raw LZMA stream that is byte-identical to LzmaEnc_MemEncode(..., writeEndMark = 0, ...) for the same props.