Skip to main content

encode

Function encode 

Source
pub fn encode(ops: &[CrdtOp]) -> Result<Vec<u8>, CodecError>
Expand description

Compressed CRDT operation batch.

Wire format:

[4 bytes] op count (LE u32)
[2 bytes] actor dictionary size (LE u16)
[actor_count × 8 bytes] actor IDs (LE u64)
[N bytes] Delta-encoded Lamport timestamps (nodedb-codec delta format)
[4 bytes] actor_index block size (LE u32)
[M bytes] actor indices (u8 if ≤256 actors, u16 otherwise)
[4 bytes] content block size (LE u32)
[K bytes] FSST-compressed content (newline-delimited)