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

Function encode_inode_vertex

atomic-core/src/pristine/tables.rs:1094–1101  ·  view source on GitHub ↗
(inode: u64, change_id: u64, start: u64, end: u64)

Source from the content-addressed store, hash-verified

1092/// Encode an inode-span as 32 bytes for use as an inode_graph key
1093#[inline]
1094pub fn encode_inode_vertex(inode: u64, change_id: u64, start: u64, end: u64) -> [u8; 32] {
1095 let mut bytes = [0u8; 32];
1096 bytes[0..8].copy_from_slice(&inode.to_be_bytes());
1097 bytes[8..16].copy_from_slice(&change_id.to_be_bytes());
1098 bytes[16..24].copy_from_slice(&start.to_be_bytes());
1099 bytes[24..32].copy_from_slice(&end.to_be_bytes());
1100 bytes
1101}
1102
1103/// Decode an inode-span from 32 bytes
1104#[inline]

Calls

no outgoing calls