MCPcopy Create free account
hub / github.com/BitVM/BitVM / calculate_double_sha256

Function calculate_double_sha256

header-chain/src/utils.rs:3–9  ·  view source on GitHub ↗
(input: &[u8])

Source from the content-addressed store, hash-verified

1use sha2::{Digest, Sha256};
2
3pub fn calculate_double_sha256(input: &[u8]) -> [u8; 32] {
4 let mut hasher = Sha256::default();
5 hasher.update(input);
6 let result = hasher.finalize_reset();
7 hasher.update(result);
8 hasher.finalize().into()
9}
10
11pub fn calculate_sha256(input: &[u8]) -> [u8; 32] {
12 let mut hasher = Sha256::default();

Callers

nothing calls this directly

Calls 2

intoMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected