Module lzzzz::lz4

source · []
Expand description

LZ4 compression and decompression.

LZ4: Extremely fast compression algorithm.

Acceleration factor

Some functions take the acceleration factor.

Larger value increases the processing speed in exchange for the lesser compression ratio.

// The default factor is 1 so both have the same meaning.
lz4::compress_to_vec(data, &mut buf, lz4::ACC_LEVEL_DEFAULT)?;
lz4::compress_to_vec(data, &mut buf, 1)?;

// Factors lower than 1 are interpreted as 1 so these are also the same as above.
lz4::compress_to_vec(data, &mut buf, 0)?;
lz4::compress_to_vec(data, &mut buf, -100)?;

// Faster but less effective compression.
lz4::compress_to_vec(data, &mut buf, 1000)?;

Structs

Streaming LZ4 compressor.

Streaming LZ4 decompressor.

Constants

Predefined acceleration level (1).

Functions

Performs LZ4 block compression.

Appends compressed data to Vec<u8>.

Decompresses an LZ4 block.

Decompresses an LZ4 block until the destination slice fills up.

Decompresses an LZ4 block with a dictionary.

Calculates the maximum size of the compressed output.