@remato/personal-code-to-birthday
v1.2.0
Published
Converts personal identification codes from various countries into birthdate
Downloads
298
Keywords
Readme
Personal Code to Birthday
Converts personal identification codes from various countries into birthdate.
Features
- Automatic Birthdate Extraction: Effortlessly extracts birthdates from national ID codes.
- Built-in Validation: Confirms personal code validity using checksum verification before returning a date.
- Country-Agnostic: Automatically identifies and processes the country format, requiring no additional parameters.
- Lightweight & Seamless Integration: Designed for easy integration into any project with minimal setup.
Limitations
- Date Range Restriction: Only supports personal codes issued from 1900 to the present. Future-dated codes are not currently supported.
Installation
npm install @remato/personal-code-to-birthday
Usage
const birthday = personalCodeToBirthday('39309262855')
console.log(birthday) // outputs { day: 26, month: 9, year: 1993 }
Countries supported
- 🇺🇦 Ukraine
- 🇪🇪 Estonia
- 🇱🇻 Latvia
- 🇱🇹 Lithuania
- 🇵🇱 Poland
- 🇫🇮 Finland
- 🇸🇪 Sweden
- 🇳🇴 Norway
- 🇩🇰 Denmark
- 🇷🇴 Romania
Need support for a new country or have feedback? Create an issue.