+
Skip to content

Update cnp.js #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update cnp.js #1

wants to merge 1 commit into from

Conversation

smaryuss
Copy link

@smaryuss smaryuss commented Jan 7, 2016

47 is for Ilfov county. CNPs from Ilfov county were not validated.

47 is for Ilfov county. CNPs from Ilfov county were not validated.
@alexei
Copy link
Owner

alexei commented Jan 7, 2016

According to https://ro.wikipedia.org/wiki/Cod_numeric_personal Ilfov is 23

Please provide a source.

@smaryuss
Copy link
Author

smaryuss commented Jan 7, 2016

Check this CNP: 2691128470037

@alexei
Copy link
Owner

alexei commented Jan 7, 2016

I mean provide a fairly credible source that lists counties and their codes. If that's a valid CNP, then maybe the whole algorithm is broken.

I see several online validators (validari.ro, wtools.ro, valideaza.ro, validare.ro) do indeed validate given CNP, but don't recognise the county. So my assumption is they don't check the county code range. When you generate a new one, however, for Ilfov, with the same sex and birthdate, you'll notice the county code is 23.

@smaryuss
Copy link
Author

smaryuss commented Jan 7, 2016

Ok, my mistake. I have an ID card for this person and it's born in Bucharest, district 2, and now living in Ilfov county (I missread). So I guess in 1969 they didn't respect the county code for Buc. sector 2.
So your algorithm is not fully correct. That's why I proposed the change.

@smaryuss
Copy link
Author

So, do you have any suggestion for improvement? If you accept my change this CNP will validate but I don't know if this is the complete revision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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