Expand description
ยงmaskify
A zero-dependency, blazing-fast Rust crate for masking sensitive data.
Built by Daniyal Masih โ a senior Rust developer focused on building high-quality, production-ready crates for the Rust ecosystem.
ยงSupported Data Types
- ๐ง Email addresses
- ๐ฑ Phone numbers
- ๐ณ Credit/Debit card numbers
- ๐ค Names
- ๐ IP addresses (IPv4 & IPv6)
- ๐ชช Aadhaar numbers (India)
- ๐ชช PAN card numbers (India)
- โ๏ธ Custom masking with builder pattern
ยงQuick Start
use maskify::MaskExt;
let email = "user@example.com";
assert_eq!(email.mask_email(), "u***@example.com");
let phone = "9876543210";
assert_eq!(phone.mask_phone(), "98******10");Structsยง
- Masker
- A builder for creating reusable custom masking strategies.
Traitsยง
- MaskExt
- Extension trait โ call masking methods directly on
&strandString.
Functionsยง
- mask_
aadhaar - Masks an Aadhaar number โ shows only last 4 digits in formatted output.
- mask_
all - Masks an entire string with asterisks.
- mask_
card - Masks a credit/debit card number.
- mask_
custom - Custom masking โ you decide how many characters to keep at the start and end.
- mask_
email - Masks an email address.
- mask_ip
- Masks an IP address โ shows only the first octet (IPv4) or first group (IPv6).
- mask_
name - Masks a name โ keeps first letter of each word.
- mask_
pan - Masks a PAN card number โ keeps first and last character.
- mask_
phone - Masks a phone number.