-
Notifications
You must be signed in to change notification settings - Fork 10
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
Update BsnUtil.java #40
base: master
Are you sure you want to change the base?
Conversation
A bsn can be send to 3rd parties who expect a Numeric 8-9 value. eg 005084039 will be send as 5084039. This will be rejected. assertThat(bsnUtil.testBsn("005084039")).isFalse();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But are these 3rd parties correct in that the first two digits may not be zeroes? I could not find any documentation of the Dutch government stating this explicitly.
@@ -23,7 +23,7 @@ public String generateBsn() { | |||
int Nr2 = randomUtil.random(10); | |||
int Nr1 = 0; | |||
int SofiNr = 0; | |||
if ((Nr9 == 0) && (Nr8 == 0) && (Nr7 == 0)) { | |||
if (Nr9 == 0 && Nr8 == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove the third clause here (I have to admit I don't actually know this generation code very well, but you don't mention this in your PR text).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pvreeuwijk was this removal intentional? Can you explain to me why this clause should not (or does not have to) be there?
Co-authored-by: Fried Hoeben <github@hsac.nl>
moved starts with check "00" next to bsn.length() != 9 check
A bsn can be send to 3rd parties who expect a Numeric 8-9 value. eg 005084039 will be send as 5084039. This will be rejected.
assertThat(bsnUtil.testBsn("005084039")).isFalse();