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

Function encode_position

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

Source from the content-addressed store, hash-verified

849/// Encode a position as 16 bytes
850#[inline]
851pub fn encode_position(change_id: u64, pos: u64) -> [u8; 16] {
852 let mut key = [0u8; 16];
853 key[0..8].copy_from_slice(&change_id.to_be_bytes());
854 key[8..16].copy_from_slice(&pos.to_be_bytes());
855 key
856}
857
858/// Decode a position from 16 bytes
859#[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