Closed teebu closed 1 year ago
Should now be available -> PR #45 should add it.
I can't find any site talking about the length of Personalausweisnummer as being 24.
Can you add tests for short format.
Here's some I scraped from the sample sites - added optional D:
'2406055684',
'2406055684d',
'2406055684D',
'T220001293D',
'T220001293',
'L01X00T471'
I found this that mentions German ID being 29 digits (24 if not including optional fields), and includes gender value. The regex they show almost matches your tests.
(?i:\b[0-9A-Z]{9}[0-9]D?[ -]?[0-9]{6}[0-9][ -MF]?[0-9]{6}[0-9][ -]?[0-9]\b)
Matches a 29-character long alphanumeric string, where:
Character 1–9 is a digit from [0–9] or an alphanumeric character from [A-Z]
Character 10 is a digit from [0–9].
Character 11 is an optional character that starts with the letter 'D'.
Character 12 is delimited with space or hyphen (optional).
Character 13–19 is a digit from [0–9].
Character 20 is delimited with space or hyphen or a letter 'M' or 'F' (optional).
Character 21–27 is a digit from [0–9].
Character 28 is delimited with space or hyphen (optional)
Character 29 is a digit from [0–9].
Bug in test: https://github.com/koblas/stdnum-js/blob/1b1933e79e9d1703dad8e423b27805a1dbb385b0/src/de/pwnr.ts#L67
missing .test()
PR #48 should resolve all of these issues, please review and let me know.
Looks good, I have yet to find documentation on the "new" 26 length format, because the "new" and current format is the 11, it is used in the ID of a German person I talked to. The previous one didn't have letters, as Microsoft points out.
Can you point me where you found it?
The first set of numbers is a combination of the issuing agency and a sequence number. If you review the list most of these are numeric, but it looks like most of the E-Pass (whatever that is, have alphanumeric coding)
http://www.pruefziffernberechnung.de/Begleitdokumente/BKZ.shtml
I think I see now, its found here http://www.pruefziffernberechnung.de/R/Reisepass-DE.shtml
The 11 digits (passport serial) + dob + some other numbers = 26 chars
Can you add DE Personalausweisnummer regex:
^[lmnprtvwxy][0-9cfghjklmnprtvwxyz]{8}[0-9][d]?
some Refs: http://www.pruefziffernberechnung.de/P/Personalausweis-DE.shtml https://learn.microsoft.com/en-us/microsoft-365/compliance/sit-defn-germany-identity-card-number?view=o365-worldwide https://www.php-einfach.de/diverses/personalausweis-ueberpruefen/
It's alpha char convert to digit (if present) and a repeating weight of 7,3,1 and the check digit is last digit, sometimes has optional 'D' in the value in the end.