Generate and validate the Italian tax identification code.
The only official tax code is the one provided by the tax office, which handles cases of identical tax codes (which is a pretty frequent case for people not born in Italy, as in this case the 4-characters town code in the codice fiscale is replaced by a 3-digit country code), an arbitrary changing of a tax code, as well as cases where a code is incorrect, but still valid (because provided by the tax office).
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.
The number is issued by the Italian tax office. Each person in the past was handed a plastic card with a magnetic strip, bearing the tax code as well as the surname, given name(s), sex, place and province of birth (or country of birth if foreign), date of birth and date of issue. Today, the tax or fiscal code card has been replaced by a combined Italian health insurance card for qualifying residents which shows an expiration date.