The CodiceFiscale is an identification code that every person who pays taxes in Italy must have.
It is calculated on the basis of specific algorithms. For the name and surname it is based on the consonants and on the length of it. For the year the last two digits are taken. There is a special table for the month.
For gender we use M for male and F for female. For the day for male it is the date marked, instead for female it must be increased by 40.
Then there are four identifying characters for the municipality of birth, consisting of a letter and three numbers. If a person was born abroad, the character is always z.
At the end there is a control character that makes the code unique, obtained on two tables, one for even characters, another for odd characters that assigns a value that is eventually divided by 26.
I was inspired by this link:
To use it is simple just look at aia file.