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

Function encode_position

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

Source from the content-addressed store, hash-verified

821/// Encode a position as 16 bytes
822#[inline]
823pub fn encode_position(change_id: u64, pos: u64) -> [u8; 16] {
824 let mut key = [0u8; 16];
825 key[0..8].copy_from_slice(&change_id.to_be_bytes());
826 key[8..16].copy_from_slice(&pos.to_be_bytes());
827 key
828}
829
830/// Decode a position from 16 bytes
831#[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