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

Function encode_position

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

Source from the content-addressed store, hash-verified

830/// Encode a position as 16 bytes
831#[inline]
832pub fn encode_position(change_id: u64, pos: u64) -> [u8; 16] {
833 let mut key = [0u8; 16];
834 key[0..8].copy_from_slice(&change_id.to_be_bytes());
835 key[8..16].copy_from_slice(&pos.to_be_bytes());
836 key
837}
838
839/// Decode a position from 16 bytes
840#[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