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

Function encode_position

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

Source from the content-addressed store, hash-verified

1113/// Encode a position as 16 bytes
1114#[inline]
1115pub fn encode_position(change_id: u64, pos: u64) -> [u8; 16] {
1116 let mut key = [0u8; 16];
1117 key[0..8].copy_from_slice(&change_id.to_be_bytes());
1118 key[8..16].copy_from_slice(&pos.to_be_bytes());
1119 key
1120}
1121
1122/// Decode a position from 16 bytes
1123#[inline]

Calls

no outgoing calls