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

Function sha256

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

Compute SHA-256 hash of a byte slice.

(data: &[u8])

Source from the content-addressed store, hash-verified

95
96/// Compute SHA-256 hash of a byte slice.
97pub fn sha256(data: &[u8]) -> [u8; 32] {
98 let mut hasher = Sha256::new();
99 hasher.update(data);
100 hasher.finalize().into()
101}
102
103/// Format a SHA-256 hash as a hex string.
104pub fn sha256_hex(data: &[u8]) -> String {

Callers 4

get_or_compileMethod · 0.85
sha256_hexFunction · 0.85
sha256_deterministicFunction · 0.85
sha256_different_inputsFunction · 0.85

Calls 2

updateMethod · 0.45
finalizeMethod · 0.45

Tested by 2

sha256_deterministicFunction · 0.68
sha256_different_inputsFunction · 0.68