MCPcopy Create free account
hub / github.com/PerroEngine/Perro / read_u64_le

Function read_u64_le

perro_source/core/perro_ids/src/ids.rs:42–51  ·  view source on GitHub ↗
(bytes: &[u8], offset: usize)

Source from the content-addressed store, hash-verified

40}
41
42const fn read_u64_le(bytes: &[u8], offset: usize) -> u64 {
43 (bytes[offset] as u64)
44 | ((bytes[offset + 1] as u64) << 8)
45 | ((bytes[offset + 2] as u64) << 16)
46 | ((bytes[offset + 3] as u64) << 24)
47 | ((bytes[offset + 4] as u64) << 32)
48 | ((bytes[offset + 5] as u64) << 40)
49 | ((bytes[offset + 6] as u64) << 48)
50 | ((bytes[offset + 7] as u64) << 56)
51}
52
53pub fn parse_hashed_source_uri(s: &str) -> Option<u64> {
54 if s.as_bytes().iter().all(|b| b.is_ascii_digit()) {

Callers 1

string_to_u64Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected