Bogus icon indicating copy to clipboard operation
Bogus copied to clipboard

Fix incorrect generation for Finnish social security number

Open roeyskoe opened this issue 3 years ago • 0 comments

There were three issues with calculating control character for Finnish personal identity code (henkilötunnus).

  1. Three-digit part after birthdate was not taken into account when calculating it.
  2. Invalid characters were not skipped.
  3. Gender was ignored.

It was also (rarely) possible to get 000 or 001 as the number part, both of which invalid.

This also changes that the number part is always between 002-899. Numbers 900-999 do not exist "in the wild", they are strictly reserved for temporary identity codes. There could of course be an option to also allow temporary codes, or generate only them. I can add them if you wish.

How the identity code is formed: https://dvv.fi/en/personal-identity-code

Fixes #392

roeyskoe avatar Jun 12 '22 17:06 roeyskoe