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

Function sha256_hex

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

Compute the lowercase-hex sha256 of `bytes`.

(bytes: &[u8])

Source from the content-addressed store, hash-verified

309
310/// Compute the lowercase-hex sha256 of `bytes`.
311fn sha256_hex(bytes: &[u8]) -> String {
312 let mut hasher = Sha256::new();
313 hasher.update(bytes);
314 hex_encode(&hasher.finalize())
315}
316
317/// Serialize a JSON value to bytes, mapping serialization failure to an IO error
318/// so callers can use `?` against `std::io::Result`.

Callers 1

write_image_layoutFunction · 0.85

Calls 3

hex_encodeFunction · 0.85
updateMethod · 0.80
finalizeMethod · 0.45

Tested by

no test coverage detected