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

Function decode_file_index

atomic-core/src/pristine/tables.rs:379–391  ·  view source on GitHub ↗
(value: &[u8; 52])

Source from the content-addressed store, hash-verified

377/// Returns (mtime_secs, mtime_nanos, file_size, content_hash).
378#[inline]
379pub fn decode_file_index(value: &[u8; 52]) -> (i64, u32, u64, crate::types::Hash) {
380 let mtime_secs = i64::from_le_bytes(value[0..8].try_into().unwrap());
381 let mtime_nanos = u32::from_le_bytes(value[8..12].try_into().unwrap());
382 let file_size = u64::from_le_bytes(value[12..20].try_into().unwrap());
383 let mut hash_bytes = [0u8; 32];
384 hash_bytes.copy_from_slice(&value[20..52]);
385 (
386 mtime_secs,
387 mtime_nanos,
388 file_size,
389 crate::types::Merkle(hash_bytes),
390 )
391}
392
393// V3 Change Storage Tables
394//

Callers 4

get_file_indexMethod · 0.85
iter_file_indexMethod · 0.85
get_file_indexMethod · 0.85
iter_file_indexMethod · 0.85

Calls 2

MerkleClass · 0.85
unwrapMethod · 0.45

Tested by

no test coverage detected