Expand description
LZ4 block compression.
Structs§
- CompressorN
- A reusable no-dict block compressor (owning) with
Nhash-table entries. - Compressor
RefN - A reusable no-dict block compressor with
Nhash-table entries. - Dict
CompressorN - A reusable dict block compressor (owning) with
Nentries per table. - Dict
Compressor RefN - A reusable dict block compressor (borrowing) with
Nentries per table. - Dict
Trainer - Trains an LZ4 dictionary from sample messages using the COVER algorithm.
Enums§
- Compress
Error - 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
inputintooutput. output should be preallocated with a size ofget_maximum_output_size. - compress_
into_ with_ dict - Compress all bytes of
inputintooutputusing 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.
- Compressor
Ref - A reusable no-dict block compressor with the standard 8 KB hash table.
- Dict
Compressor - A reusable dict block compressor (owning) with the standard 8 KB tables.
- Dict
Compressor Ref - A reusable dict block compressor (borrowing) with the standard 8 KB tables.