Skip to main content

Crate lz4rip_encode

Crate lz4rip_encode 

Source
Expand description

LZ4 block compression.

Structs§

CompressorN
A reusable no-dict block compressor (owning) with N hash-table entries.
CompressorRefN
A reusable no-dict block compressor with N hash-table entries.
DictCompressorN
A reusable dict block compressor (owning) with N entries per table.
DictCompressorRefN
A reusable dict block compressor (borrowing) with N entries per table.
DictTrainer
Trains an LZ4 dictionary from sample messages using the COVER algorithm.

Enums§

CompressError
Errors that can happen during compression.

Constants§

DEFAULT_DICT_ENTRIES
Default entry count for the dict (u16-valued) tables: 4096 x 2 B = 8 KB.
DEFAULT_NODICT_ENTRIES
Default entry count for the no-dict (u32-valued) table: 2048 x 4 B = 8 KB.
MIN_ENTRIES
Smallest permitted hash-table entry count: 256 (an 8-bit index). Below this the hash collapses 5 input bytes onto too few buckets to find matches, so the compressor degrades to emitting literals. Matches C lz4’s floor (LZ4_MEMORY_USAGE_MIN = 10 -> 1 << (10 - 2) = 256-entry table).

Functions§

compress
Compress all bytes of input.
compress_into
Compress all bytes of input into output. output should be preallocated with a size of get_maximum_output_size.
compress_into_with_dict
Compress all bytes of input into output using an external dictionary.
get_maximum_output_size
Returns the maximum output size of the compressed data. Can be used to preallocate capacity on the output vector.

Type Aliases§

Compressor
A reusable no-dict block compressor (owning) with the standard 8 KB table.
CompressorRef
A reusable no-dict block compressor with the standard 8 KB hash table.
DictCompressor
A reusable dict block compressor (owning) with the standard 8 KB tables.
DictCompressorRef
A reusable dict block compressor (borrowing) with the standard 8 KB tables.