codice-fiscale-italiano
v1.0.1
Published
Italian fiscal code validation library
Downloads
5,889
Readme
codice-fiscale-italiano
Italian fiscal code validation library for JavaScript / Libreria per la validazione del codice fiscale italiano per JavaScript
The Italian fiscal code card, officially known as Italy's Codice Fiscale, is the tax code card in Italy, similar to a Social Security Number (SSN) card in the United States or the National Insurance Number issued in the United Kingdom. The tax code in Italy is an alphanumeric code of 16 characters. The card serves to identify unambiguously individuals residing in Italy irrespective of residency status. Designed by and for the Italian tax office, it is now used for several other purposes, e.g. uniquely identifying individuals in the health system, or natural persons who act as parties in private contracts. (from Wikipedia)
This library provides validation only. It does not generate fiscal codes, as they must be issued by the Italian authorities.
Installation / Installazione
npm install codice-fiscale-italiano
Usage / Utilizzo
returns true
if CF is a valid fiscal code, false
otherwise
NodeJS
const codiceFiscaleItaliano = require('codice-fiscale-italiano')
codiceFiscaleItaliano(CF) // or
codiceFiscaleItaliano.validateCF(CF)
Browser
<script src='codice-fiscale-italiano.js'></script>
then
validateCF(CF)
Credits
Regex: http://blog.marketto.it/2016/01/regex-validazione-codice-fiscale-con-omocodia/