LibCNPJAlfanumerico 1.0.0

dotnet add package LibCNPJAlfanumerico --version 1.0.0
                    
NuGet\Install-Package LibCNPJAlfanumerico -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="LibCNPJAlfanumerico" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LibCNPJAlfanumerico" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="LibCNPJAlfanumerico" />
                    
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 LibCNPJAlfanumerico --version 1.0.0
                    
#r "nuget: LibCNPJAlfanumerico, 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 LibCNPJAlfanumerico@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=LibCNPJAlfanumerico&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=LibCNPJAlfanumerico&version=1.0.0
                    
Install as a Cake Tool

CNPJ Alfanumérico - Biblioteca (V1.0.0)

Esta biblioteca permite validar, limpar ou gerar CNPJs conforme o novo projeto da Receita Federal que será aplicado para as novas inscrições de CNPJs a partir de Julho de 2026.

Estrutura do projeto LibCNPJAlfanumerico

LibCNPJAlfanumerico
|   LibCNPJAlfanumerico.sln      # Arquivo de projeto Visual Studio
|
\---CNPJ
        CNPJ.cs                  # Classe com as funções (Validar, Limpar e Gerar) da biblioteca 

Guia de Utilização da biblioteca

  1. Baixe o último release e importe para o seu projeto

    v1.0.0 LibCNPJAlfanumerico.dll

  2. Utilize os métodos Validar, Limpar ou Gerar

    Exemplo:

     string cnpj = LibCNPJAlfanumerico.CNPJ.Gerar(); // Gerar um CNPJ randômico
    
     cnpj = LibCNPJAlfanumerico.CNPJ.Limpar($"CNPJ: {cnpj}"); // Para limpar o CNPJ, caso tenha algum resíduo
    
     if (LibCNPJAlfanumerico.CNPJ.Validar(cnpj)) // Verificando se o CNPJ é um CNPJ válido ou não
     {
     	Console.WriteLine(cnpj); // CNPJ válido
     }
    

Contribua

  1. Crie uma nova pull request com melhorias
  2. De uma estrela para o projeto

Licença

MIT

Product Compatible and additional computed target framework versions.
.NET 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.
  • 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.0.0 158 2/4/2026

A biblioteca permite:

* Validar se o CNPJ Alfanumérico é válido ou não
* Limpar CNPJ (Retirar espaços e caracteres especiais)
* Gerar automaticamente CNPJs Alfanuméricos (matriz e filial)