image/svg+xml
Magic
Valid ZS fileab 5a 53 66 69 4c 65 01
OR
Incomplete (corrupt) ZS fileab 5a 53 74 6f 42 65 01
Data and index blocks
Lengthuleb128
Levelu8
CRC-64-xzu64le
compress(Block payload)see below
Data blocks have level 0; index blocks have level in range 1-63.Payload format depends on block type.
Data block payload format
Record 1 lengthuleb128
Record 1 contentsarbitrary bytes
...
Index block payload format
Block 1 key lengthuleb128
Block 1 keyarbitrary bytes
Block 1 offsetuleb128
Block 1 lengthuleb128
...
Data payloads contain one or more concatenated, sorted, length-prefixed records.
Level n payloads contain one or more concatenated references to level (n - 1) blocks.
Block payload formats
+
+
+
Record 2 lengthuleb128
Record 2 contentsarbitrary bytes
Each payload is compressed, and then embedded inside a data or index block.
ZS file format: detailed internal structure
Magic
Header
Block
+
+
Block
+
Block
+
+
...
Header
Lengthu64le
Root offsetu64le
CRC-64-xzu64le
Length and CRC are computed for this data
Root lengthu64le
File lengthu64le
SHA-25632 bytes
Codec16 bytes
Metadata lengthu64le
Metadatautf8 JSON object
Future extensions go here