Validates Iranian National ID (Code Melli) using the official checksum algorithm.
Logic:
code = ('0000' + code).substr(length + 4 - 10)
parseInt(code.substr(3, 6))
0
c = parseInt(code.substr(9, 1))
c
The national ID as a string or number.
An optional configuration object.
Optional
Check the first 3 digits of the national ID against a predefined list of valid city codes.
true Copy
true
A boolean indicating whether the ID is valid.
Validates Iranian National ID (Code Melli) using the official checksum algorithm.
Logic:
code = ('0000' + code).substr(length + 4 - 10)
parseInt(code.substr(3, 6))
is0
, reject.c = parseInt(code.substr(9, 1))
).c
).