Crate rzip
Expand description
Implementation of the rzip 2.1 compression format.
Faithful safe Rust port from Andrew Tridgell and Rusty Russell’s C
implementation in old/unix-tools/rzip-2.1/.
rzip uses a two-stage compression approach:
- Long-distance redundancy elimination across large chunks (up to 100MB+),
emitting match offsets and literals split across two streams:
- Stream 0: control stream (literal headers, match headers with offsets, EOF sentinel, and CRC-32 checksum).
- Stream 1: raw literal bytes.
- Second-stage bzip2 compression and block-level interleaving with forward-linked 13-byte chunk headers.
Constants§
- CRC_
TABLE - Table generated using Mark Adler’s CRC-32 polynomial algorithm (0xEDB88320).
Functions§
- compress_
bytes - Convenience helper to compress an in-memory byte slice.
- compress_
stream - Compresses a stream from
readerintowriterusing therzip2.1 format. - decompress_
bytes - Convenience helper to decompress an in-memory byte slice.
- decompress_
stream - Decompresses a stream from
readerintowriterusing therzip2.1 format.