MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / decode_branch_value

Function decode_branch_value

atomic-core/src/crdt/tables.rs:553–562  ·  view source on GitHub ↗
(bytes: &[u8; 24])

Source from the content-addressed store, hash-verified

551/// Decode branch data from 24 bytes.
552#[inline]
553pub fn decode_branch_value(bytes: &[u8; 24]) -> SerializedBranch {
554 let trunk_id = decode_trunk_id(bytes[0..12].try_into().unwrap());
555 let state = decode_branch_state(bytes[12]);
556 let line_hash = u64::from_le_bytes(bytes[16..24].try_into().unwrap());
557 SerializedBranch {
558 trunk_id,
559 state,
560 line_hash,
561 }
562}
563
564// Leaf Value Encoding/Decoding (22 bytes)
565

Calls 3

decode_trunk_idFunction · 0.85
decode_branch_stateFunction · 0.85
unwrapMethod · 0.45