PNF (ЛНЧ, Личен номер на чужденец, Bulgarian number of a foreigner).
The personal number of a foreigner is a 10-digit number where the last digit is the result of a weighted checksum.
>>> validate('7111 042 925')
'7111042925'
>>> validate('7111042922') # invalid check digit
Traceback (most recent call last):
...
InvalidChecksum: ...
>>> validate('71110A2922') # invalid digit
Traceback (most recent call last):
...
InvalidFormat: ...
Calculate the check digit. The number passed should not have the check digit included.
Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.
Checks to see if the number provided is a valid national identification number. This checks the length, formatting, embedded date and check digit.
Checks to see if the number provided is a valid national identification number. This checks the length, formatting, embedded date and check digit.