Skip to main content

Crate maskify

Crate maskify 

Source
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 &str and String.

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.