mask-pii for Hare
Use mask-pii in Hare to mask email addresses and phone numbers when you write logs or process data.
Mask email addresses
Mask part of the email address before the @ and leave the domain visible.
Mask phone numbers
Mask the phone number and leave the last four digits visible.
Choose what to mask
Before you run it, choose whether to mask email addresses, phone numbers, or both. You can also pick the character to use.
Install it and try an example
A package for Hare Project Library is planned. Get the tagged source and load the Hare API. Run the example to turn on email and phone masking and see the result.
Installation
git clone --branch v0.2.0 --depth 1 https://github.com/finitefield-org/mask-pii.git
Try an example
main.ha
use fmt;
use maskpii;
export fn main() void = {
let m = maskpii::new();
maskpii::mask_emails(&m);
maskpii::mask_phones(&m);
maskpii::with_mask_char(&m, '#');
let input = "Contact: alice@example.com or 090-1234-5678.";
let output = maskpii::process(&m, input)!;
defer free(output);
fmt::println(output);
// Output: "Contact: a####@example.com or ###-####-5678."
};
More details
See the README for package details and API examples for this language.
Previous
Language indexNext
GitHub