Crate mask_text

Source
Expand description

mask-text

This is a library to mask text with multiple masking options

§Example:

§Percentage:

fn main() {
    println!(
        "{}",
        mask_text::Kind::Percentage("text to mask".to_string(), 80, 3, "*".to_string()).mask()
    );
}

§Regex:

use regex::Regex;

fn main() {
    let re = Regex::new("([a-z].*) (mask) ([a-z].*)").unwrap();
    println!(
        "{}",
        mask_text::Kind::Regex("text to mask on group".to_string(), re, 2, "*".to_string()).mask()
    );
}

See more masking option

Enums§

Kind