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

Function hex_bytes

atomic-core/src/operation/mod.rs:967–975  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

965}
966
967fn hex_bytes(bytes: &[u8]) -> String {
968 const HEX: &[u8; 16] = b"0123456789abcdef";
969 let mut result = String::with_capacity(bytes.len() * 2);
970 for byte in bytes {
971 result.push(HEX[(byte >> 4) as usize] as char);
972 result.push(HEX[(byte & 0x0f) as usize] as char);
973 }
974 result
975}

Callers 1

fmtMethod · 0.70

Calls 2

lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected