rustvital-amd / src /proof.rs
brainworm2024's picture
Final ROCm-ready: real inference, orchestrator, proof, polished UI, HIP comments
4a90885
raw
history blame
424 Bytes
use sha2::{Digest, Sha256};
use crate::shield::redact::PiiMatch;
pub fn generate_proof(original: &str, pii_map: &[PiiMatch]) -> String {
let mut hasher = Sha256::new();
hasher.update(original.as_bytes());
for m in pii_map {
hasher.update(m.entity_type.as_bytes());
hasher.update(m.original.as_bytes());
hasher.update(m.placeholder.as_bytes());
}
hex::encode(hasher.finalize())
}