MCPcopy Create free account
hub / github.com/cosdata/cosdata / hash_again

Method hash_again

src/models/crypto.rs:45–53  ·  view source on GitHub ↗

Computes double-pass SHA256 hash by hashing this single-pass SHA256 again

(&self)

Source from the content-addressed store, hash-verified

43
44 // Computes double-pass SHA256 hash by hashing this single-pass SHA256 again
45 pub fn hash_again(&self) -> DoubleSHA256Hash {
46 // Second pass: hash the first hash result
47 let double_hash = digest::digest(&digest::SHA256, &self.0);
48
49 // Convert to fixed-size array
50 let mut result = [0u8; 32];
51 result.copy_from_slice(double_hash.as_ref());
52 DoubleSHA256Hash(result)
53 }
54
55 #[allow(unused)]
56 pub fn verify_eq(&self, other: &Self) -> bool {

Callers 3

create_sessionFunction · 0.80
get_admin_keyFunction · 0.80

Calls 1

DoubleSHA256HashClass · 0.85