CodiceFiscale 1.0.1
dotnet add package CodiceFiscale --version 1.0.1
NuGet\Install-Package CodiceFiscale -Version 1.0.1
<PackageReference Include="CodiceFiscale" Version="1.0.1" />
paket add CodiceFiscale --version 1.0.1
#r "nuget: CodiceFiscale, 1.0.1"
// Install CodiceFiscale as a Cake Addin #addin nuget:?package=CodiceFiscale&version=1.0.1 // Install CodiceFiscale as a Cake Tool #tool nuget:?package=CodiceFiscale&version=1.0.1
CodiceFiscale
A .NET Core library to calculate and validate the Italian Tax Code (Codice Fiscale)
Table of Contents
Description
The CodiceFiscale library provides an easy-to-use interface for generating and validating the Italian Tax Code based on personal data such as name, surname, date of birth, and city of birth.
It is designed for .NET developers who need to work with the Italian Tax Code in applications like tax management, user registration, and government service integrations.
Installation
You can install the CodiceFiscale library via NuGet Package Manager:
dotnet add package CodiceFiscale --version X.X.X
Or by adding the following to your .csproj:
<PackageReference Include="CodiceFiscale" Version="X.X.X" />
Once installed, restore the packages:
dotnet restore
Usage
Here’s a few examples of how to use the library:
Generate a Codice Fiscale
using CodiceFiscaleLib.Helpers;
string result =
.Encode("Rossi", "Mario", 'M', new DateTime (1980, 5, 20), "Milano");
Console.WriteLine($"Generated Codice Fiscale: {result}");
Decode a Codice Fiscale
using CodiceFiscaleLib.Helpers;
// decode
var decoded = DecodingHelper.Decode(code);
// get the dictionary
var decodedDict = (Dictionary<string, string>)decoded["raw"];
// access the value
string firstName = decodedDict["firstname"];
Console.WriteLine($"Decoded Codice Fiscale First Name: {firstName}");
Validate a Codice Fiscale
using CodiceFiscaleLib.Helpers;
bool isValid = DecodingHelper.IsValid("RSSMRA80E20F205I");
Console.WriteLine($"Is valid Codice Fiscale: {isValid}");
Contributing
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository
- Create a new branch (git checkout -b feature/your-feature)
- Commit your changes (git commit -am 'Add new feature')
- Push the branch (git push origin feature/your-feature)
- Open a Pull Request
Please ensure all pull requests pass the existing tests and include new tests for any added functionality
License
This project is licensed under the GPL-3.0 License. See the LICENSE file for more details
Acknowledgments
Special thanks to all contributors and resources that made this project possible
Product | Versions 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. |
-
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.