Skip to content

Validate Swedish personnummer (personal identity numbers)

License

Notifications You must be signed in to change notification settings

ullenius/pnummer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

personnummer-forth

personnummer-forth is a Forth stand-alone command line app for validating Swedish personnummer (personal identity numbers).

Usage: gforth main.fs [PERSONNUMMER]... -e bye

Features

  • Verifies the checksum digit (Luhn algorithm).
  • Date validation
  • Century validation

Input format

Format: ccYYmmDDXXXC, for example: 202511142388

  • cc - Century (18-20). Not used by checksum algorithm.
  • YY - Year 00-99
  • MM - Month 01-12
  • C - Checksum digit

Requirements

  • gforth 0.7.3 or higher
  • bash (tests only)

Tests

Run unit tests: ./test.sh

All test data is from Skatteverket (testpersonnummer).

Licence

GPL-3 only

References

About

Validate Swedish personnummer (personal identity numbers)

Topics

Resources

License

Stars

Watchers

Forks