PII masking para sa logs at pipelines sa Rust.

I-mask ang email at global phone numbers nang ligtas, mabilis, at may minimal dependencies. Dinisenyo para sa logging at data processing workflows.

Email Masking

Pinananatili ang domain at unang local character: alice@example.com -> a****@example.com.

Global Phone Formats

Pinananatili ang formatting at huling 4 digits: +1 (800) 123-4567 -> +1 (***) ***-4567.

Custom at Lightweight

Palitan ang mask character at panatilihing minimal ang dependencies (regex lang).

Installation & Basic Usage

Gamitin ang cargo add mask-pii (o idagdag ang mask-pii = "0.1.0" sa Cargo.toml) at i-enable ang masking gamit ang builder pattern.

Installation

cargo add mask-pii

Usage

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() walang masking. I-enable muna ang email/phone filters bago mag-process.