UniversalMask
A Rust library that makes it easy to format sensitive variables with specific masks, such as SSN, phone numbers, or other data that requires a standard format.
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Usage
use mask;
// SSN formatting
let ssn = mask;
assert_eq!;
// Phone number formatting
let phone = mask;
assert_eq!;
// Multiple format options (separated by '|')
let number = mask;
assert_eq!;
// Complex formatting with longer patterns
let multi_format = mask;
assert_eq!;
Features
- Apply masks to text according to specified formats
- Support for multiple format patterns
- Automatic selection of the most suitable format based on input length
- Minimal dependencies and efficient implementation
Version History
0.1.0 - Initial Release
- Basic masking functionality
- Support for multiple format patterns
- Performance optimizations using byte operations