Norwegian SSN: Incorrect format
See original GitHub issueThe format for Norwegian SSN is 11 digits:
- The first six digits represent the date of birth in the order date, month, year
- The next three digits are an individual number, the third digit of which indicates gender – even numbers for women and odd numbers for men
- The last two digits are control digits
More details: http://www.skatteetaten.no/en/person/National-Registry/Birth-and-name-selection/Children-born-in-Norway/National-ID-number/
Steps to reproduce
from faker import Faker
fake = Faker('no_NO')
print(fake.ssn())
The SSN format for ‘no_NO’ is currently ‘465-18-3530’: https://faker.readthedocs.io/en/master/locales/no_NO.html#faker-providers-ssn
Expected behavior
SSN should be on the format specified here: http://www.skatteetaten.no/en/person/National-Registry/Birth-and-name-selection/Children-born-in-Norway/National-ID-number/
This would be nice: Get a SSN (“fødselsnummer”: the birth date and the 5 digits after) for a female or male person born on a specific date:
from faker import Faker
fake = Faker('no_NO')
# Get Norwegian SSN for a female born on December 31 2000
gender = 'F'
year = 2000
month = 12
day = 31
fodselsnummer = fake.ssn(gender, year, month, day) # 11 digits
Maybe an option to get only the last 5 digits?
fodselsnummer.py here may be useful: https://github.com/magnuswatn/fodselsnummer
Actual behavior
SSN returned is on the format ‘465-18-3530’.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
Your PR looks great @frangiz!
I have a pull request if @magnuswatn does not have time to fix one.