Skip to content

Constants ​

The following constants are exposed by lz4 for format introspection, buffer sizing, and protocol integration.

Magic Numbers ​

ConstantValueDescription
lz4.FRAME_MAGIC0x184D2204Standard LZ4 Frame Format magic identifier (Little Endian).
lz4.LEGACY_MAGIC0x184C2102Legacy LZ4 frame magic number from older tooling.
lz4.SKIPPABLE_MAGIC_MIN0x184D2A50Lower bound of the 16 skippable user frame magic numbers.
lz4.SKIPPABLE_MAGIC_MAX0x184D2A5FUpper bound of the 16 skippable user frame magic numbers.
lz4.END_MARK0x000000004-byte block size marker designating the end of blocks in a frame.

Algorithm & Size Limits ​

ConstantValueDescription
lz4.MINMATCH4Minimum byte length for an LZ4 back-reference match sequence.
lz4.MAX_DISTANCE65535Maximum backwards offset distance (64 KiB - 1 byte).
lz4.MAX_INPUT_SIZE0x7E000000Maximum single-block uncompressed size (~2,113,929,216 bytes).

Block Capacity Limits ​

ConstantValueDescription
BLOCK_SIZE_64KB65,536 bytes64 KiB uncompressed block buffer capacity.
BLOCK_SIZE_256KB262,144 bytes256 KiB uncompressed block buffer capacity.
BLOCK_SIZE_1MB1,048,576 bytes1 MiB uncompressed block buffer capacity.
BLOCK_SIZE_4MB4,194,304 bytes4 MiB uncompressed block buffer capacity.

Released under the MIT License.