Suture Binary Format 1
All integers are big-endian. All hashes are SHA-256 and occupy 32 bytes.
A patch consists of a payload followed by SHA256(payload).
| Field | Type | Meaning |
|---|---|---|
| magic | 8 bytes | 53 55 54 55 52 45 1A 01 |
| version | int32 | 1 |
| minSize | int32 | CDC minimum chunk size |
| averageSize | int32 | CDC average chunk size, power of two |
| maxSize | int32 | CDC maximum chunk size |
| parityGroupSize | int32 | configured group size, 0 means disabled |
| targetLength | int64 | reconstructed target length |
| sourceHash | 32 bytes | SHA-256 of the source used during creation |
| targetHash | 32 bytes | SHA-256 of the required target |
| operationCount | int32 | number of operations |
Operations
Заголовок раздела «Operations»COPY, type 0
Заголовок раздела «COPY, type 0»| Field | Type |
|---|---|
| type | uint8 |
| length | int32 |
| chunkHash | 32 bytes |
| anchorLength | uint8, 1..16 |
| anchor | variable |
| parityGroupId | int32, -1 when unprotected |
The anchor is the beginning of the referenced chunk. A reader must verify the complete chunk hash before accepting an anchor hit.
LITERAL, type 1
Заголовок раздела «LITERAL, type 1»| Field | Type |
|---|---|
| type | uint8 |
| codec | uint8, 0 raw, 1 raw DEFLATE stream |
| rawLength | int32 |
| storedLength | int32 |
| data | variable |
Parity section
Заголовок раздела «Parity section»| Field | Type |
|---|---|
| parityGroupCount | int32 |
Each group then contains:
| Field | Type |
|---|---|
| id | int32 |
| memberCount | int32 |
| parity block | encoded block |
Parity is XOR of all group chunks padded with zero bytes to the longest member length.
Trailer
Заголовок раздела «Trailer»| Field | Type |
|---|---|
| payloadHash | 32 bytes |
A conforming implementation must reject checksum failure, unknown operation types, malformed lengths, inconsistent operation output length, invalid group membership, failed recovered-chunk hashes, and final target hash mismatch.