Skip to main content

content_hash

Function content_hash 

Source
pub fn content_hash(compressed_bytes: &[u8]) -> String
Expand description

Compute the SHA-256 hex digest of compressed payload bytes.

Returns a 64-character lowercase hex string suitable for use as a dedup key or content-addressable identifier.

§Examples

use manasight_parser::util::content_hash;

let hash = content_hash(b"hello");
assert_eq!(hash.len(), 64);
assert_eq!(hash, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824");