Repository navigation
Accept South Korean RRNs given out since October 2020 - #530
Open
wonjangcloud9 wants to merge 1 commit into
Open
wonjangcloud9 wants to merge 1 commit into
wonjangcloud9 wants to merge 1 commit into
Conversation
Since 2020-10-05 newly assigned resident registration numbers have six random digits after the seventh digit instead of a place of birth, serial number and check digit. The place of birth and check digit checks rejected about 90% of the numbers of children born since then. The number does not say when it was given out, so skip these checks for dates of birth from 2020-09-05 on (a birth has to be reported within a month). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since 2020-10-05, a newly assigned resident registration number (a newborn's, or one changed after a leak) has six random digits after the seventh digit: the place of birth, serial number and check digit were dropped (Seoul Shinmun, reporting the Ministry of the Interior and Safety plan; the Enforcement Rule of the Resident Registration Act was amended on 2020-10-05; the Wikipedia article also notes that these digits are random after October 2020).
kr.rrn.validate()still requires the place of birth to be at most 96 and the check digit to match, so it rejects most numbers of children born since then. Out of 100,000 numbers built that way for birth dates in 2021-2025, 9.7% pass on master (87.3%InvalidChecksum, 3.0%InvalidComponent).The number itself does not say when it was given out. This skips the place of birth and check digit checks for dates of birth from 2020-09-05 on, since a birth has to be reported within a month. Older numbers are validated as before. Numbers changed after 2020-10-05 for people born earlier also have random digits and are still rejected; I left those out because accepting them would mean dropping the check digit for everyone.
New doctests cover a 2021 number with a "place of birth" of 99 and a wrong check digit, the 2020-09-05 boundary on both sides, and an invalid 2021 date of birth.
The full test suite passes with 100% coverage.
🤖 Generated with Claude Code