Metadata for this ID type
Parse ID number (if applicable)
Validate an ID number
StaticchecksumCalculate the Luhn (mod 10) check digit over the first 9 digits.
Weights are [2,1,2,1,2,1,2,1,2] with products >9 having 9 subtracted;
luhnDigit (multipliersStartByTwo=true) implements this exactly.
Returns null unless the input matches the cédula layout, as the Python
library does (#299): nine digits, an optional hyphen or whitespace
separator, a final digit, and a province code (digits 1-2) of 01-24 or
30. The input's own last digit and the person-type (third digit) rule are
not applied here; validate() does that.
StaticparseParse Ecuador cédula number
StaticvalidateValidate the ECU cédula number
Ecuador Cédula de Identidad (national identity number) https://en.wikipedia.org/wiki/National_identification_number#Ecuador
Structure: PPTSSSSSSC PP - province code (01-24, or 30 for citizens registered abroad) T - person type, 0-5 for a natural-person cédula (4-5 when PP is 30) SSSSSS - sequential registration number C - Luhn (mod 10) check digit
Deliberately stricter than python-stdnum in two respects (both verified against official Registro Civil guidance, not just "the reference impl"):