All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Format information for all 40 European countries via
getCountryIdFormat()— each now returns aformatdisplay mask, a validexample, achecksumAlgorithmdescription, and theofficialName(local name) (#42) IdMetadataandIdFormatgain optionalexample,checksumAlgorithm, andofficialNamefields, populated from each country's METADATA (#42)- Format information for all 26 Asian countries via
getCountryIdFormat()—formatdisplay mask, validexample,checksumAlgorithmdescription, andofficialName(local name) (#43)
- Portugal (PRT)
idTypecorrected from "Citizen Card" to "Tax Identification Number (NIF)" to match the registered NIF validator (#42) - Nigeria (NGA) NIN
parse()now returns{ isValid: true }for valid NINs (previously{ checksum: null }) — the NIN is a randomly-assigned number that encodes no personal data, mirroring the Python source (parsable: False); added full validate/parse/checksum and registry-integration test coverage (#46)
- Corrected inaccurate
displayFormatmasks for Indonesia (IDN), Kazakhstan (KAZ), Kuwait (KWT), and Vietnam (VNM); Bangladesh (BGD) now reports the full accepted length range{ min: 13, max: 17 }covering both old and new national ID formats (#43)
- Comprehensive Portugal (PRT) Cartão de Cidadão (CC) validation tests — valid format coverage, first/second check digit validation, invalid length, character position, and format edge cases (#34)
- Comprehensive Portugal (PRT) NIF (Número de Identificação Fiscal) validation tests — individual/legal entity/public entity/other type prefixes, modulus 11 checksum, invalid first digit, length, and character handling (#35)
- Portugal (PRT) parse() and edge case tests — CC and NIF component extraction, entity type identification, input handling (null/undefined/empty/whitespace), format variations (spaces, dashes, mixed case), and error paths (#36)
- Comprehensive New Zealand (NZL) driver license validation tests — valid/invalid formats, letter/digit position edge cases, case handling (#31)
- New Zealand (NZL) parse() function and edge case tests — component extraction, input handling (null/empty/whitespace), format edge cases, boundary values (#33)
1.6.0 - 2026-04-07
- Norway (NOR) D-nummer support:
NationalID.parse()now detects D-nummer IDs (DD field 41–71) and returnsidType: 'd-nummer'vs'fodselsnummer'(#29) NationalIdParseResultnow includes optionalidType?: 'fodselsnummer' | 'd-nummer'discriminator field; always populated byparse()(#29)- Comprehensive Norway (NOR) fødselsnummer validation tests — valid IDs across 1800s/1900s/2000s centuries, leap year, invalid dates/checksums (#28)
- Comprehensive Norway (NOR) D-nummer validation tests — valid/invalid IDs, boundary conditions, fødselsnummer differentiation (#29)
- Norway (NOR) checksum and parse() function tests — check digit validation, birth date/gender/idType extraction, error handling (#30)
- Python parity deviation: D-nummer support is a documented TypeScript-side extension. The Python
idnumberslibrary currently rejects D-nummer inputs (itsparse()callsdate(year, mm, dd)directly, raisingValueErrorfordd >= 32). This module accepts the D-nummer range (DD 41–71) per issue #29's acceptance criteria. The checksum algorithm and all other behaviors remain identical to the Python source. The Python library should add the same logic to restore full parity.
1.5.0 - 2026-04-04
- Comprehensive Slovakia (SVK) validate() tests — valid/invalid IDs, male/female birth numbers, pre/post-1954 formats (#22)
- Comprehensive Slovakia (SVK) parse() tests — birth date extraction, gender, century handling, sequence numbers (#23)
- Slovakia (SVK) edge case and error tests — invalid formats, dates, checksums, boundary conditions (#24)
1.4.1 - 2026-03-29
- Add npm provenance for verified publish badge (#91)
1.4.0 - 2026-03-29
- 11 secondary ID types ported from Python
idnumberslibrary (#86, #90):- AUS:
TaxFileNumber,DriverLicenseNumber - AUT:
EntityTaxIDNumber(VAT/UID) - BEL:
EntityVAT - BGR:
UnifiedIdCode(UIC/EIK/BULSTAT) - CHE:
BusinessID(UID) - GRC:
OldIdentityCard(deprecated) - KAZ:
BusinessIDNumber(BIN) - KOR:
OldResidentRegistration(deprecated) - LVA:
OldPersonalCode(deprecated) - VEN:
FiscalInformationNumber(RIF)
- AUS:
- Corrected BGR century calculation for
monthPart > 20(#83, #87) - Fixed TUR validation negative modulus handling (#83, #87)
- Replaced SGP check letter maps with per-prefix tables (#83, #87)
- Applied JPN My Number weights in correct forward order (#83, #87)
- Rewrote LKA validation with proper checksum algorithm (#83, #87)
- Removed checksum validation from DNK CPR (matches Python source) (#84, #88)
- Removed first-digit restriction from CAN SIN (#84, #88)
- Removed year clamping and fixed gender threshold in ALB (#84, #88)
- Removed hardcoded test ID bypasses across 12 countries (ARE, AUS, CHE, CZE, EST, ITA, LVA, NGA, NZL, PHL, PRT, SVK) — all now use proper algorithmic validation (#85, #89)
1.3.0 - 2026-02-17
- Validator registry pattern with
ValidatorRegistryclass (#50, #79) - Registry adapters for all 80 country validators (#52, #79)
resolveKey()method onValidatorRegistryfor alias resolution (#51, #80)- ADR-001 documenting the validator registry design (#49)
- Comprehensive Hungary
parse()tests (#45, #75)
parseIdInfo()now delegates to registry lookup instead of switch statement (#52, #79)validateNationalId()now delegates to registry lookup instead of switch statement (#51, #80)getCountryIdFormat()now delegates to registry lookup instead of switch statement (#53, #81)getCountryIdFormat()return type tightened fromany | nulltoIdFormat | null(#53)- Replaced
as anytest assertions withas unknown as stringfor type safety (#64, #74) - Former stub entries (QA, UY, EC, BO, PY, CR, PA, DO, GT, HN, SV, NI, JO, LB, OM) in
getCountryIdFormat()now returnnullinstead of non-conformant partial objects (#53)
- DNK
validate()now checks date validity, consistent withparse()(#51) - Corrected BGD, SMR, NZL validator registrations (#51)
- Fixed Cyrillic character in LKA format string (#53)
- Fixed IND
maxLengthfrom 12 to 14 to match actual METADATA (#53)
1.2.0 - 2025-12-25
- Added
parse()method for PNG (Papua New Guinea) National ID (#47, #72) - Added
parse()method for Ukraine EntityId (EDRPOU) withEntityTypeenum (#48, #72) - Added comprehensive test suite for PNG and Ukraine EntityId (58 tests)
- Fixed EDRPOU checksum algorithm edge case where second-pass modulus 10 should normalize to check digit 0 (#72)
1.1.0 - 2025-11-30
- Removed dead code for Peru (PE) validator (#19, #63)
- Removed dead code for Tunisia (TN) validator (#20, #63)
- Removed incomplete implementation comment (#21, #65)
1.0.1 - 2025-11-17
- Corrected Lithuanian century digit mapping for accurate year parsing (#1)
- Improved test coverage for Lithuanian ID validation
1.0.0 - 2025-11-02
- Initial release with support for 80 countries
- National ID validation functionality
- Parse functions to extract information from national IDs
- Full TypeScript support with type definitions
- Comprehensive documentation and examples