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

Function hex

atomic-agent/src/record/scope.rs:48–57  ·  view source on GitHub ↗

Lowercase hex of a digest. `digest` 0.11 dropped the `LowerHex` output.

(bytes: &[u8])

Source from the content-addressed store, hash-verified

46
47/// Lowercase hex of a digest. `digest` 0.11 dropped the `LowerHex` output.
48fn hex(bytes: &[u8]) -> String {
49 use std::fmt::Write as _;
50
51 let mut out = String::with_capacity(bytes.len() * 2);
52 for byte in bytes {
53 // Writing to a `String` cannot fail.
54 let _ = write!(out, "{byte:02x}");
55 }
56 out
57}
58
59/// `digest` 0.11 removed its `std::io` impls and its `std` feature, moving
60/// them to the separate `digest-io` crate (RustCrypto/traits#1809), so

Callers 2

checkpointFunction · 0.70
unescape_repo_pathFunction · 0.50

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected