Skip to main content

Crate omnizip_lz4

Crate omnizip_lz4 

Source
Expand description

Pure-Rust LZ4 codec — in-house block + frame encoder + decoder.

Two variants are registered as separate codecs:

  • Lz4FastCodec (codec id LZ4): port of the C reference’s fast loop (lz4 -1); ratio within 0.4% of the reference CLI.
  • Lz4HcCodec (codec id LZ4_HC): high-compression encoder with hash-chain match finder + lazy parsing (see [hc]). 2-3× better ratio at the cost of slower encode.

Both use the same LZ4 block format with a 4-byte LE original-size prefix. The in-house encoder + decoder are implemented from spec in block and frame.

Modules§

block
LZ4 block-format encoder + decoder (pure-Rust, from spec).
frame
LZ4 frame format encoder + decoder (pure-Rust, from spec).
streaming
Streaming LZ4 compression.

Structs§

Lz4FastCodec
LZ4 fast codec — port of LZ4_compress_generic (see block).
Lz4HcCodec
LZ4 high-compression codec. Uses an in-house hash-chain match finder + lazy parsing (see [hc]). Same decode path as Lz4FastCodec — produces LZ4 block-format bytes that any LZ4 decoder can read.

Functions§

compress_frame
Compress using LZ4 frame format (compatible with lz4 -d CLI).
decompress_frame
Decompress an LZ4 frame (compatible with lz4 CLI output).