PESEL is the national identification number used in Poland since 1979. It always has 11 digits, identifies just one person and cannot be changed to another one. The PESEL number is mandatory for all permanent residents of Poland and for temporary residents living in Poland for over 2 months. After 1 March 2015, applicants for Polishpassport without a PESEL number will need to apply for PESEL prior to passport application. Otherwise, without a PESEL number, passport application and fingerprints cannot be taken. The PESEL was the system designed by the communist government to trace personal information about every citizen. It is a direct offshoot from the previous system, MAGISTER, which was designed to trace and record data about everyone with a university degree.
Format
PESEL number has the form of YYMMDDZZZXQ, where YYMMDD is the date of birth, ZZZX is the personal identification number, where X codes sex and Q is a check digit, which is used to verify whether a given PESEL is correct or not.
Checksum calculation
Having a PESEL in the form of ABCDEFGHIJK, one can check the validity of the number by computing the following expression: A*1 + B*3 + C*7 + D*9 + E*1 + F*3 + G*7 + H*9 + I*1 + J*3 The checksum is the last digit of result of the above expression subtracted from 10. If this last digit is 0 then the checksum is 0. If the result of the last operation is not equal to the last digit of a given PESEL, the PESEL is incorrect. This system works reliably well for catching one-digit mistakes and digit swaps.
Example: Checking validity of PESEL 44051401358
4*1 + 4*3 + 0*7 + 5*9 + 1*1 + 4*3 + 0*7 + 1*9 + 3*1 + 5*3 = 101 The last digit of the result : 1 The last digit is not 0 so, the checksum is 10 - 1 = 9 9 is not equal to the last digit of PESEL, which is 8, so the PESEL number contains errors.
How to code this in TypeScript
export function validatePesel: boolean function getMultiplier: number
Birthdates
The PESEL system has been designed to cover five centuries. To distinguish people born in different centuries, numbers are added to the MM field:
for birthdates between 1900 and 1999 - no change to MM field is made
for other birthdates:
*2000–2099 - month field number is increased by 20
*2100–2199 - month + 40
*2200–2299 - month + 60
*1800–1899 - month + 80
For example, a person born on December 24, 2002 would have a PESEL number starting with 023224 and person born on December 24, 1902 would have a PESEL number starting with 021224.
Changing the PESEL number
PESEL contains the date of birth and a sex, so the number is changed if the person changes their sex or corrects their date of birth. The other situation when the number is changed is "if the previous number was produced in the violation of Law". When the PESEL number is changed, the person is not allowed to use the previous number anymore. The previous number of a person cannot be given to anyone else.
Other identifiers
A similar system of identification numbers exists for businesses, called REGON. Also all business taxpayers have a tax identification number called NIP'. Individuals in Poland are often asked to provide the number of their Polish identity card' as identification. Similarly, businesses and corporations are often required to state the number at which they appear in the register of businesses, KRS - National Judicial Register, or the Taxpayer Identification Number - NIP.