use sanitize_engine::category::Category;
use sanitize_engine::generator::HmacGenerator;
use sanitize_engine::store::MappingStore;
use std::sync::Arc;
fn main() {
let generator = Arc::new(HmacGenerator::new([42u8; 32]));
let store = MappingStore::new(generator, Some(1_000_000));
let pairs = [
(Category::Email, "alice@corp.com"),
(Category::Email, "bob@corp.com"),
(Category::IpV4, "192.168.1.42"),
(Category::Name, "Alice Johnson"),
];
for (category, original) in &pairs {
let sanitized = store
.get_or_insert(category, original)
.expect("replacement should succeed");
println!("{category:>8} | {original:<20} → {sanitized}");
}
let first = store
.get_or_insert(&Category::Email, "alice@corp.com")
.unwrap();
let second = store
.get_or_insert(&Category::Email, "alice@corp.com")
.unwrap();
assert_eq!(first, second);
println!("\nConsistency check passed: repeated lookups return the same value.");
}