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

Function hex_encode

atomic-repository/src/oci.rs:302–308  ·  view source on GitHub ↗

Lowercase-hex encode bytes.

(bytes: &[u8])

Source from the content-addressed store, hash-verified

300
301/// Lowercase-hex encode bytes.
302fn hex_encode(bytes: &[u8]) -> String {
303 let mut s = String::with_capacity(bytes.len() * 2);
304 for b in bytes {
305 s.push_str(&format!("{b:02x}"));
306 }
307 s
308}
309
310/// Compute the lowercase-hex sha256 of `bytes`.
311fn sha256_hex(bytes: &[u8]) -> String {

Callers 1

sha256_hexFunction · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected