Crate rzip

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:

  1. 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.
  2. 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 reader into writer using the rzip 2.1 format.
decompress_bytes
Convenience helper to decompress an in-memory byte slice.
decompress_stream
Decompresses a stream from reader into writer using the rzip 2.1 format.