Rust-da loqlar və boru kəmərləri üçün PII maskalaması.
E-poçt ünvanlarını və qlobal telefon nömrələrini təhlükəsiz, sürətli və minimal asılılıqlarla maskalayın. Loqlama və məlumat emalı iş axınları üçün nəzərdə tutulub.
Email Masking
Preserves the domain and the first local character: alice@example.com -> a****@example.com.
Global Phone Formats
Keeps formatting and the last 4 digits: +1 (800) 123-4567 -> +1 (***) ***-4567.
Custom & Lightweight
Change the mask character and keep dependencies minimal (regex only).
Quraşdırma və əsas istifadə
cargo add mask-pii istifadə edin (və ya Cargo.toml-a mask-pii = "0.2.0" əlavə edin) və builder pattern ilə maskalamanı aktivləşdirin.
Quraşdırma
cargo add mask-pii
İstifadə
src/main.rs
use mask_pii::Masker;
fn main() {
// Configure the masker
let masker = Masker::new()
.mask_emails()
.mask_phones()
.with_mask_char('#');
let input = "Contact: alice@example.com or 090-1234-5678.";
let output = masker.process(input);
println!("{}", output);
// Output: "Contact: a####@example.com or 090-####-5678."
}
Important Note
By default, Masker::new() performs no masking. Enable email/phone filters explicitly before processing text.
Əvvəlki
Language indexNövbəti
GitHub