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

Function encode_position

atomic-core/src/pristine/tables.rs:863–868  ·  view source on GitHub ↗
(change_id: u64, pos: u64)

Source from the content-addressed store, hash-verified

861/// Encode a position as 16 bytes
862#[inline]
863pub fn encode_position(change_id: u64, pos: u64) -> [u8; 16] {
864 let mut key = [0u8; 16];
865 key[0..8].copy_from_slice(&change_id.to_be_bytes());
866 key[8..16].copy_from_slice(&pos.to_be_bytes());
867 key
868}
869
870/// Decode a position from 16 bytes
871#[inline]

Callers 6

position_inodeMethod · 0.85
put_inodeMethod · 0.85
del_inodeMethod · 0.85
put_inodesMethod · 0.85
position_inodeMethod · 0.85

Calls

no outgoing calls

Tested by 1