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

Function decode_leaf_id

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

Source from the content-addressed store, hash-verified

317/// Decode a LeafId from 12 bytes.
318#[inline]
319pub fn decode_leaf_id(bytes: &[u8; 12]) -> LeafId {
320 let change_id = NodeId::new(u64::from_le_bytes(bytes[0..8].try_into().unwrap()));
321 let leaf_idx = u32::from_le_bytes(bytes[8..12].try_into().unwrap());
322 LeafId::new(change_id, leaf_idx)
323}
324
325// Span Position Encoding/Decoding (24 bytes)
326

Callers 3

get_file_lines_by_trunkFunction · 0.85

Calls 1

unwrapMethod · 0.45

Tested by 2