question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Norwegian SSN: Incorrect format

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
magnuswatncommented, Mar 7, 2018

Your PR looks great @frangiz!

1reaction
frangizcommented, Mar 7, 2018

I have a pull request if @magnuswatn does not have time to fix one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Norwegian Personal Identification Number - progsbase.com
The first six digits are the birth date (DDMMYY) and the last five digits are the Person Number (Personummer ). The century is...
Read more >
Social security number or D-number – NYDBP.NO
Fatal error: Uncaught Error: Call to undefined method WP_Textdomain_Registry::reset() in ...
Read more >
National identity number, D number or international ID ...
Don't have a Norwegian national identity number or D number ; international ID; name; date of birth, and; employee number (voluntary) ; ID...
Read more >
National identity number - UDI
A national identity number is an ID number for you with a residence permit who are going to live in Norway for more...
Read more >
How to validate SSN (Social Security Number) using Regular ...
The first part should have 3 digits and should not be 000, 666, or between 900 and 999. The second part should have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found