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

Function hex_bytes

atomic-cli/src/commands/op/model.rs:772–780  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

770}
771
772fn hex_bytes(bytes: &[u8]) -> String {
773 const HEX: &[u8; 16] = b"0123456789abcdef";
774 let mut encoded = String::with_capacity(bytes.len() * 2);
775 for byte in bytes {
776 encoded.push(HEX[(byte >> 4) as usize] as char);
777 encoded.push(HEX[(byte & 0x0f) as usize] as char);
778 }
779 encoded
780}

Callers 1

fromMethod · 0.70

Calls 2

lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected