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

Function hash_u8

code/chapter09/blockchain/blockchain2/utils/src/serializer.rs:19–23  ·  view source on GitHub ↗

计算 value 哈希值并传递给 out 参数

(value: &[u8], mut out: &mut [u8])

Source from the content-addressed store, hash-verified

17
18// 计算 value 哈希值并传递给 out 参数
19pub fn hash_u8(value: &[u8], mut out: &mut [u8]) {
20 let mut hasher = Sha3::sha3_256();
21 hasher.input(value);
22 hasher.result(&mut out);
23}

Callers 1

runMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected