Skip to content

HV-2114 Add support for Korean foreigner RRN validation #1642

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: main
Choose a base branch
from

Conversation

lcalmsky
Copy link

@lcalmsky lcalmsky commented Jun 9, 2025

This change adds support for Korean Resident Registration Numbers (RRNs) issued to foreign residents living in Korea.

Currently, the KorRRNValidator rejects RRNs with gender digits 5 to 8, which represent foreign males and females born in the 1900s and 2000s:

  • 5: Foreign male, born 1900–1999
  • 6: Foreign female, born 1900–1999
  • 7: Foreign male, born 2000–2099
  • 8: Foreign female, born 2000–2099

By adding these digits to the GENDER_DIGIT list, this validator now correctly accepts valid RRNs for foreign residents.

Jira Issue: HV-2114


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on licensing, please check here.


@@ -90,7 +99,7 @@ private static boolean isValidDate(final String rrn) {
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 );
return (day <= 30 || month != 4 && month != 6 && month != 9 && month != 11) && (day <= 29 || month != 2);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified the conditional statement.

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.

1 participant