Skip to content

Constants & Magic Identifiers ​

The xz package exposes format constants, filter IDs, and integrity check identifiers defined by the XZ container specification.


1. Stream Magic & Framing ​

ConstantValueDescription
HEADER_MAGIC"\xFD7zXZ\x00"6-byte magic identifier at the start of every XZ stream
FOOTER_MAGIC"YZ" (0x59, 0x5A)2-byte magic identifier at the end of every XZ stream
STREAM_HEADER_SIZE12 bytesTotal byte size of the Stream Header
STREAM_FOOTER_SIZE12 bytesTotal byte size of the Stream Footer

2. Filter Identifiers ​

ConstantValueDescription
FILTER_LZMA20x21LZMA2 compression filter (mandatory last filter)
FILTER_DELTA0x03Delta byte distance filter
FILTER_X86_BCJ0x04x86 / x86_64 BCJ branch-call-jump address translator

3. Check Type Identifiers ​

ConstantIDCheck Field SizeAlgorithm
CHECK_NONE0x000 bytesNo integrity check
CHECK_CRC320x014 bytesIEEE 802.3 CRC32
CHECK_CRC640x048 bytesECMA-182 reversed polynomial CRC64
CHECK_SHA2560x0A32 bytesCryptographic SHA-256

4. Variable-Length Integer (VLI) Limits ​

ConstantValueDescription
VLI_MAX9223372036854775807 ($2^{63}-1$)Maximum allowed VLI value
VLI_BYTES_MAX9 bytesMaximum serialized byte length of a single VLI

5. Package Information ​

ConstantValueDescription
version"0.0.1"Library version string

Released under the MIT License.