+
Skip to content

alexei/cnp.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

cnp.js

Romanian Personal Identification Number (Cod Numeric Personal, or CNP) validator

The CNP has the following format:

G YY MM DD CC NNN C
| |  |  |  |  |   |
| |  |  |  |  |   +- Checksum
| |  |  |  |  +----- Serial Number
| |  |  |  +-------- County Code
| |  |  +----------- Day (of birth)
| |  +-------------- Month (of birth)
| +----------------- Year (of birth)
+------------------- Gender

Gender

  • 1 - male born between 1900 and 1999
  • 2 - female born between 1900 and 1999
  • 3 - male born between 1800 and 1899
  • 4 - female born between 1800 and 1899
  • 5 - male born after 2000
  • 6 - female born after 2000
  • 7 - male
  • 8 - female
  • 9 - Foreign citizen

County Code

1 to 52 or 99 For Bucharest, the code is 4 folowed by the sector number (1-6)

Checksum

To calculate the checksum, every digit from CNP is multiplied with the digit with the same index from the number 279146358279, the results are sumed up and then divided by 11. If the remainder is 10 then the checksum digit is 1, otherwise it's the remainder itself.

About

Romanian Personal Identification Number (Cod Numeric Personal, or CNP) validator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载