Skip to content

HV-2113 Adding Korean resident registration number validation condition #1640

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private static boolean isValidChecksum(final String rrn) {
private static boolean isValidDate(final String rrn) {
final int month = extractMonth( rrn );
final int day = extractDay( rrn );
if ( month > 12 || day < 0 || day > 31 ) {
if ( month < 1 || month > 12 || day < 1 || day > 31 ) {
return false;
}
return day <= 31 && ( day <= 30 || ( month != 4 && month != 6 && month != 9 && month != 11 ) ) && ( day <= 29 || month != 2 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ void testNeverAttrWithoutHyphen() {
void invalidDate() {
assertInvalidRRN( "861324-2567481" );
assertInvalidRRN( "960292-2499371" );
assertInvalidRRN( "000001-1234560" );
assertInvalidRRN( "000100-1234560" );
assertInvalidRRN( "000000-1234560" );
}

// Invalid RRN Length
Expand Down