LZ4 frame
An LZ4 frame wraps data blocks in a descriptor and end marker, with optional length, dictionary identification and integrity checks.
The frame API reports frame completion separately from consumed input and produced output. A complete first frame can leave another frame unread, while a truncated end marker can follow all expected payload bytes. [2]
A controlled liblz4 experiment swaps two independent blocks with their checksums intact. Block-only verification accepts the reordered frame; adding the original content checksum rejects it. Declared length alone does not detect this same-length rearrangement. [3]
Relations
- related
- Block-independent compression, Compression dictionary, Checksum, Skippable frame (Zstandard), Restore test
Citations
- LZ4 v1.9.4 public frame API: preferences and LZ4F_decompress completion contract
- Hesela: LZ4 frame checks, block order and completion
Further reading
Sources & caveats
- The synthetic experiment uses liblz4 1.9.4 and no dictionary; observations are not a corruption-rate estimate or security guarantee.