polish-id-card-validate

1.0.1 • Public • Published

Simple polish ID card number validator

Build Status License NPM Version Downloads

Currently polish ID card numbers contains of three letters and six digits. Valid numbers are written in format "XXX NNNNNN", where "X" is a letter and "X" is a digit. The space character is optional.

The control digit is first digit, after letters. For example in number: "ABS 123456" control digit equal "1".

In algorithm of control digit validation letters are presented as numbers, where "A" equal "10" and "Z" qeual "35". In polish ID card are allowed only latin letters.

Using validator:

First steep - instalation from NPM:

npm install polish-id-card-validate

Using validator in the application code:

const validate = require( 'polish-id-card-validate' );
 
validate( 'ABS123456' ); //true
validate( 'abs123456' ); //true
 
validate( 'ABS 123456' ); //true
validate( 'abs 123456' ); //true
 
validate( 'ABS523456' ); //false, invalid control digit!

Validator can be use only for new ID card numbers in format "XXX NNNNNN". For old ID card numbers (without control digit) validator returns always FALSE.

Readme

Keywords

none

Package Sidebar

Install

npm i polish-id-card-validate

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • tomek-sochacki