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

Function decode_trunk_id

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

Source from the content-addressed store, hash-verified

265/// ```
266#[inline]
267pub fn decode_trunk_id(bytes: &[u8; 12]) -> TrunkId {
268 let change_id = NodeId::new(u64::from_le_bytes(bytes[0..8].try_into().unwrap()));
269 let file_idx = u32::from_le_bytes(bytes[8..12].try_into().unwrap());
270 TrunkId::new(change_id, file_idx)
271}
272
273/// Encode a BranchId as 12 bytes for storage.
274///

Callers 8

decode_branch_valueFunction · 0.85
get_trunk_by_pathMethod · 0.85
get_trunk_by_pathMethod · 0.85
recordMethod · 0.85

Calls 1

unwrapMethod · 0.45

Tested by 4