faker.providers.ssn.no_NO

Package Contents

Classes

SsnProvider

Provider

Functions

checksum(→ int)

Calculate checksum of Norwegian personal identity code.

Attributes

SexLiteral

faker.providers.ssn.no_NO.SexLiteral
class faker.providers.ssn.no_NO.SsnProvider(generator: Any)

Bases: faker.providers.BaseProvider

ssn_formats: faker.providers.ElementsType[str] = ('###-##-####',)
ssn() str
faker.providers.ssn.no_NO.checksum(digits: Sequence[int], scale: List[int]) int

Calculate checksum of Norwegian personal identity code.

Checksum is calculated with “Module 11” method using a scale. The digits of the personal code are multiplied by the corresponding number in the scale and summed; if remainder of module 11 of the sum is less than 10, checksum is the remainder. If remainder is 0, the checksum is 0.

https://no.wikipedia.org/wiki/F%C3%B8dselsnummer

class faker.providers.ssn.no_NO.Provider(generator: Any)

Bases: faker.providers.ssn.Provider

scale1 = (3, 7, 6, 1, 8, 9, 4, 5, 2)
scale2 = (5, 4, 3, 2, 7, 6, 5, 4, 3, 2)
ssn(dob: Optional[str] = None, gender: Optional[faker.typing.SexLiteral] = None) str

Returns 11 character Norwegian personal identity code (Fødselsnummer).

A Norwegian personal identity code consists of 11 digits, without any whitespace or other delimiters. The form is DDMMYYIIICC, where III is a serial number separating persons born oh the same date with different intervals depending on the year they are born. CC is two checksums. https://en.wikipedia.org/wiki/National_identification_number#Norway

Parameters
  • dob (str) – date of birth as a “YYYYMMDD” string

  • gender (str) – gender of the person - “F” for female, M for male.

Returns

Fødselsnummer in str format (11 digs)

Return type

str