CodiceFiscale 1.0.1

dotnet add package CodiceFiscale --version 1.0.1                
NuGet\Install-Package CodiceFiscale -Version 1.0.1                
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="CodiceFiscale" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CodiceFiscale --version 1.0.1                
#r "nuget: CodiceFiscale, 1.0.1"                
#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.
// 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

Stargazers MIT License NuGet Version Build Status LinkedIn

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:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -am 'Add new feature')
  4. Push the branch (git push origin feature/your-feature)
  5. 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 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. 
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.1 119 9/13/2024
1.0.0 117 9/13/2024