Expand description
Pure-Rust LZ4 codec — in-house block + frame encoder + decoder.
Two variants are registered as separate codecs:
Lz4FastCodec(codec idLZ4): port of the C reference’s fast loop (lz4 -1); ratio within 0.4% of the reference CLI.Lz4HcCodec(codec idLZ4_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§
- Lz4Fast
Codec - LZ4 fast codec — port of
LZ4_compress_generic(seeblock). - Lz4Hc
Codec - LZ4 high-compression codec. Uses an in-house hash-chain match
finder + lazy parsing (see [
hc]). Same decode path asLz4FastCodec— produces LZ4 block-format bytes that any LZ4 decoder can read.
Functions§
- compress_
frame - Compress using LZ4 frame format (compatible with
lz4 -dCLI). - decompress_
frame - Decompress an LZ4 frame (compatible with
lz4CLI output).