| 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()) | |
| } | |