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

Function encode_leaf_id

atomic-core/src/crdt/tables.rs:310–315  ·  view source on GitHub ↗
(id: &LeafId)

Source from the content-addressed store, hash-verified

308/// ```
309#[inline]
310pub fn encode_leaf_id(id: &LeafId) -> [u8; 12] {
311 let mut bytes = [0u8; 12];
312 bytes[0..8].copy_from_slice(&id.change_id().get().to_le_bytes());
313 bytes[8..12].copy_from_slice(&id.leaf_idx().to_le_bytes());
314 bytes
315}
316
317/// Decode a LeafId from 12 bytes.
318#[inline]

Callers 10

apply_file_ops_batchedFunction · 0.85
put_leafFunction · 0.85
update_leaf_stateFunction · 0.85
update_leaf_contentFunction · 0.85

Calls 4

to_le_bytesMethod · 0.80
leaf_idxMethod · 0.80
getMethod · 0.65
change_idMethod · 0.45