MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / hash_str

Function hash_str

code/chapter09/blockchain/blockchain1/utils/src/serializer.rs:14–18  ·  view source on GitHub ↗

计算 value 哈希值并以 String 形式返回

(value: &[u8])

Source from the content-addressed store, hash-verified

12
13// 计算 value 哈希值并以 String 形式返回
14pub fn hash_str(value: &[u8]) -> String {
15 let mut hasher = Sha3::sha3_256();
16 hasher.input(value);
17 hasher.result_str()
18}

Callers 2

newMethod · 0.50
set_hashMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected