Validator.js: Validator for passport numbers

Created on 16 Dec 2019  路  5Comments  路  Source: validatorjs/validator.js

How about validating passport numbers? The passport numbers vary from country to country so the functions should be like isValidPassport(string, countryCode).

馃檵鈥嶁檪锔廸eature-request

Most helpful comment

@hamzahejja there is a international standard(sic), that could be tested.. also *CH and US has own standard).. none adhere to published "standards" maybe EU more than most.

If it stays a regexp I have no problem; if it entails downloading lists(dbs) to check against... well no.. that is the developers prerogative..

Copying definitions same

All 5 comments

Looks like a legit feature

@tux-tn @profnandaa
Do you think this is legit feature to implement? I'm willing to dig into it and provide an implementation, just found a good reference from _Microsoft_ for EU Passport Formats: EU Passport Number
, I'm sure similar formats/regex could be set-up for non-EU countries' Passport Number as well, What's your call here? Should we move along?

the validator is most likely to be something like: isPassportNumber(str, countryCode)

@hamzahejja -- this looks good to me, sure, you can go ahead 馃憤

@hamzahejja there is a international standard(sic), that could be tested.. also *CH and US has own standard).. none adhere to published "standards" maybe EU more than most.

If it stays a regexp I have no problem; if it entails downloading lists(dbs) to check against... well no.. that is the developers prerogative..

Copying definitions same

@AubreyHewes -- I think Hamza was working on a regex.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

woverton picture woverton  路  4Comments

IOAyman picture IOAyman  路  4Comments

Maxreglez picture Maxreglez  路  3Comments

malkhuzayyim picture malkhuzayyim  路  4Comments

karladler picture karladler  路  3Comments