personnummer-forth is a Forth stand-alone command line app for validating Swedish personnummer (personal identity numbers).
Usage: gforth main.fs [PERSONNUMMER]... -e bye
- Verifies the checksum digit (Luhn algorithm).
- Date validation
- Century validation
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
- gforth 0.7.3 or higher
- bash (tests only)
Run unit tests:
./test.sh
All test data is from Skatteverket (testpersonnummer).
GPL-3 only