assay-registry 3.5.1

Pack registry client for remote pack distribution (SPEC-Pack-Registry-v1)
Documentation
1
2
3
4
5
6
7
8
9
//! Digest computation for canonical pack content.

use sha2::{Digest, Sha256};

/// Compute SHA-256 hash of bytes and format as `sha256:{hex}`.
pub fn sha256_prefixed(bytes: &[u8]) -> String {
    let hash = Sha256::digest(bytes);
    format!("sha256:{}", hex::encode(hash))
}