pub const BLAKE3_PREFIX: &str = crate::layer0::vocabulary::HASH_PREFIX_BLAKE3;
pub const SHA256_PREFIX: &str = crate::layer0::vocabulary::HASH_PREFIX_SHA256;
pub fn compute_blake3(bytes: &[u8]) -> String {
crate::hash::raw_hash_bytes_for(crate::layer0::vocabulary::HASH_ALGORITHM_BLAKE3, bytes)
.expect("the central registry must contain the legacy BLAKE3 provider")
}
pub fn compute_sha256(bytes: &[u8]) -> String {
crate::hash::raw_hash_bytes_for(crate::layer0::vocabulary::HASH_ALGORITHM_SHA256, bytes)
.expect("the central registry must contain the SHA-256 provider")
}
pub fn prefixed_hash(bytes: &[u8]) -> String {
format!("{}{}", BLAKE3_PREFIX, compute_blake3(bytes))
}
pub fn verify_hash(bytes: &[u8], expected_hash: &str) -> bool {
crate::hash::verify_hash(expected_hash.trim(), bytes).is_ok()
}