MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / sha256_hex

Function sha256_hex

nodedb/src/control/planner/wasm/runtime.rs:104–106  ·  view source on GitHub ↗

Format a SHA-256 hash as a hex string.

(data: &[u8])

Source from the content-addressed store, hash-verified

102
103/// Format a SHA-256 hash as a hex string.
104pub fn sha256_hex(data: &[u8]) -> String {
105 hex_encode(&sha256(data))
106}
107
108fn hex_encode(bytes: &[u8]) -> String {
109 bytes.iter().map(|b| format!("{b:02x}")).collect()

Callers 2

store_wasm_binaryFunction · 0.70
hex_encodingFunction · 0.70

Calls 2

sha256Function · 0.85
hex_encodeFunction · 0.70

Tested by 1

hex_encodingFunction · 0.56