From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:LZ4" |
|---|
| claim | "Each data block of an LZ4 frame starts with a uint32 LE: bit 31 set means the data is stored uncompressed, bits 30-0 give the stored length (at most the block maximum size); the value 0 is the EndMark that ends the frame, while 0x80000000 is a valid empty uncompressed block. With the block checksum flag, XXH32 (seed 0) of the stored bytes follows each block." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:LZ4" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "LZ4_block_header" |
|---|
| size | 4 |
|---|
| fields | | offset | 0 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "block_size" |
|---|
| bits | | bit | "0-30" |
|---|
| name | "size" |
|---|
| notes | "bytes of data that follow (not counting the checksum)" |
|---|
|
| bit | "31" |
|---|
| name | "uncompressed" |
|---|
| notes | "1 = data stored as is" |
|---|
|
|
|---|
| notes | "0x00000000 = EndMark" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "documentation" |
|---|
| detail | "If the highest bit is set (1), the block is uncompressed ... A value of 0x00000000 is invalid, and signifies an EndMark instead ... 0x80000000 ... is an uncompressed block of size 0" |
|---|
| repo | "https://github.com/lz4/lz4" |
|---|
| commit | "aa787570e681c695fc087b4a44cd2d5b38c2289a" |
|---|
| path | "doc/lz4_Frame_format.md" |
|---|
| lines | "252-305" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "random.data.lz4 of pierrec/lz4 testdata (written by the C lz4 tool) stores its 16384 bytes in one block with header 00 40 00 80 (uncompressed); decoded byte-exactly with the Python codec on this wiki." |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Block size field" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T17:53:41.833Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T12:13:01.482Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read doc/lz4_Frame_format.md at aa78757 lines 252-305: little-endian u32, high bit = uncompressed, 0x00000000 EndMark vs 0x80000000 empty valid block, size excludes the 4-byte checksum, xxHash-32 seed 0 of the raw block; fact matches." |
|---|
|
|
|---|