Releases: djesusnet/Maskify.Core
v1.5.0
📦 Maskify.Core v1.5.0
Installation
dotnet add package Maskify.Core --version 1.5.0What's New
- ✅ Full support for alphanumeric CNPJ (Brazilian law compliance)
- ⚡ High-performance single-pass processing
- 🎯 Zero heap allocations in hot paths
See CHANGELOG.md for full details.
Full Changelog: 1.4.2...v1.5.0
v1.4.2
v1.4.1
Full Changelog: 1.4.0...1.4.1
v1.4.0
What's Changed
Mask RG
Mask Brazilian RG numbers (7 to 9 digits), formatted or unformatted:
using Maskify.Core;
// RG formatado
string rgFormatted = "46.546.987-3";
string maskedRgFormatted = Masker.MaskRG(rgFormatted);
Console.WriteLine(maskedRgFormatted); // Output: **.***.***-3
// RG não formatado
string rgUnformatted = "465469873";
string maskedRgUnformatted = Masker.MaskRG(rgUnformatted);
Console.WriteLine(maskedRgUnformatted); // Output: *******3
// RG com 7 dígitos
string rgShort = "1234567";
string maskedRgShort = Masker.MaskRG(rgShort);
Console.WriteLine(maskedRgShort); // Output: *****67v1.3.3
What's Changed
Mask License Plate
Mask Brazilian license plates (old and Mercosul formats), showing only the first 3 characters:
using Maskify.Core;
string licensePlate = "BRA2E19";
string maskedLicensePlate = Masker.MaskLicensePlate(licensePlate);
Console.WriteLine(maskedLicensePlate); // Output: BRA****New Contributors
Full Changelog: 1.0.0...1.3.3
v1.0.0
Maskify - Sensitive Data Masking Library
A simple, powerful, and efficient way to mask sensitive data.
Maskify is a powerful and easy-to-use library for masking sensitive data such as Brazilian documents (CPF, CNPJ) and emails. It also allows you to mask any other type of information through highly customizable, generic methods.
Features
- CPF Masking: Masks CPF numbers, with or without formatting.
- CNPJ Masking: Supports CNPJ formatting, allowing input with or without mask.
- Email Masking: Partially hides email addresses, preserving domain integrity.
- Generic Masking Method: Allows you to mask any type of sensitive data, such as phone numbers, addresses, and more.
Installation
You can install the package directly from NuGet:
dotnet add package MaskifyOr visit the NuGet package page: Maskify.Core on NuGet
Usage
1. Mask CPF
using Maskify.Core.Libray;
string cpf = "000.000.000-00";
string maskedCpf = Masker.MaskCPF(cpf);
Console.WriteLine(maskedCpf); // Output: ***.***.***-002. Mask CNPJ
using Maskify.Core.Libray;
string cnpj = "00.000.000/0000-00";
string maskedCnpj = Masker.MaskCNPJ(cnpj);
Console.WriteLine(maskedCnpj); // Output: **.***.***/****-003. Mask Email
using Maskify.Core.Libray;
string email = "user@example.com";
string maskedEmail = Masker.MaskEmail(email);
Console.WriteLine(maskedEmail); // Output: use****@example.com4. Mask Any Other Data
In addition to specific methods for CPF, CNPJ, and email, you can mask any type of data using the generic method:
using Maskify.Core.Libray;
string sensitiveData = "My confidential info";
string maskedData = Masker.Mask(sensitiveData, 5, 3, '*');
Console.WriteLine(maskedData); // Output: ***** confidential ****Parameters:
char: Character used for masking (e.g.,*or#).startPosition: Number of characters to keep visible at the start.length: Number of characters to mask after the start position.
1.3.2
What's Changed
Language Update: Adjusted texts and properties to English for better internationalization.
Full Changelog: https://github.com/djesusnet/Maskify.Core/commits/1.3.2
New Contributors
- @thiagocorreanet made their first contribution in #7
Full Changelog: https://github.com/djesusnet/Maskify.Core/commits/1.3.2
1.3.1
What's Changed
Bug Fixes: Mobile Phone Masking Fix: Corrected an issue with the masking of Brazilian mobile phone numbers to ensure accurate formatting.
Full Changelog: https://github.com/djesusnet/Maskify.Core/commits/1.3.1
1.3.0
New Features:
- DataAnnotations Support: Easily mask fields like CPF, CNPJ, credit cards, emails, and phone numbers (mobile and residential) directly in your models using MaskSensitiveData.
- Flexible Masking: Customize the masking character and define error messages for invalid data.
- Mobile & Residential Phone Masking: Supports Brazilian phone numbers (both mobile and residential).
Full Changelog: https://github.com/djesusnet/Maskify.Core/commits/1.3.0
1.2.1
Bug Fix
Fixed an issue where the DataType was not being correctly found within the MaskSensitiveDataAttribute. This resolves compatibility issues and ensures smoother integration when applying the DataAnnotation to properties.
Full Changelog: https://github.com/djesusnet/Maskify.Core/commits/1.2.1