Maskify.Core 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Maskify.Core --version 1.0.0
                    
NuGet\Install-Package Maskify.Core -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Maskify.Core" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Maskify.Core" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Maskify.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Maskify.Core --version 1.0.0
                    
#r "nuget: Maskify.Core, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Maskify.Core@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Maskify.Core&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Maskify.Core&version=1.0.0
                    
Install as a Cake Tool

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 Maskify

Or 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: ***.***.***-00

2. Mask CNPJ

using Maskify.Core.Libray;


string cnpj = "00.000.000/0000-00";
string maskedCnpj = Masker.MaskCNPJ(cnpj);
Console.WriteLine(maskedCnpj); // Output: **.***.***/****-00

3. Mask Email

using Maskify.Core.Libray;


string email = "user@example.com";
string maskedEmail = Masker.MaskEmail(email);
Console.WriteLine(maskedEmail); // Output: use****@example.com

4. 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.

Customization

You can customize the mask character, the number of visible digits, and much more. This makes Maskify a flexible solution for your data protection needs.

Contributing

Feel free to contribute to the project by submitting pull requests or issues on our GitHub repository. We welcome contributions that improve performance, add new features, or enhance the documentation.

License

This project is licensed under the terms of the MIT License.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.0 108 1/25/2026
1.4.3 98 1/24/2026
1.4.2 655 11/30/2024
1.4.1 226 10/28/2024
1.4.0 143 10/28/2024
1.3.3 148 10/26/2024
1.3.2 141 10/24/2024
1.3.1 151 10/23/2024
1.3.0 144 10/23/2024
1.2.1 231 10/23/2024
1.1.1 156 10/17/2024
1.0.0 972 10/16/2024