Skip to content
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

Swdeden personalidentitynumber - format acceptance and age validations #113

Open
teebu opened this issue Jan 3, 2024 · 2 comments
Open
Assignees

Comments

@teebu
Copy link

teebu commented Jan 3, 2024

https://swedish.identityinfo.net/personalidentitynumber

The format states the [-+] are optional.

  • 11900102-2384 -> invalid because it needs + to indicate over 100 years of age, also im thinking 1800 should be a cutoff.
    119001022384 would also be an acceptable format, but not pass due to 1800 cutoff (1190 is YYYY)
  • 5505260017 -> valid because - is optional
  • 198902255630 -> valid because - is optional
  • 19781204+0009 -> invalid because + indicates age is over 100 years
  • 19200102-0755 -> invalid because - indicates the age is under 100 years
@koblas koblas self-assigned this Jan 10, 2024
@teebu
Copy link
Author

teebu commented Jan 10, 2024

I wonder if the - and + gets assigned only once during creation, and gets updated after a person turns 100 to make it accurate after they roll over 100 mark. I bet that doesn't happen often, most people don't live that long. 🤔

What happens to old records that were accurate at the time of entry with - but not today, as many years have passed and rolled them over 100 mark.

Probably explains why they are optional and use full year.

@koblas
Copy link
Owner

koblas commented Jan 10, 2024

I've been working on this... It makes sense to "fix" the year to 4 digits and perform all validation after that. Not "stress" over the +- difference for the long form version.

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

No branches or pull requests

2 participants