Skip to main content

speccoder_openspec/
hash.rs

1//! Content hashes for the tick and append guards.
2
3use sha2::{Digest, Sha256};
4
5/// Lowercase hex SHA-256 of `bytes`.
6#[must_use]
7pub fn sha256_hex(bytes: &[u8]) -> String {
8    Sha256::digest(bytes)
9        .iter()
10        .map(|b| format!("{b:02x}"))
11        .collect()
12}