A CPR-nummer (plural: CPR-numre) is a Danish government citizen ID number assigned by "Det Centrale Personregister" (CPR). It is also known as personnummer ("person number").
The CPR-nummer is used for a number of purposes such as e.g. tax reporting, identifying people in legal documents and in NemID, the government-provided Danish two-factor authentication system. It is also used for NemKonto where you can transfer money to an account by the owners' CPR-nummer without knowing the account details.
This library makes using it simple and supports the often-missed edge cases such as modulus checksums and valid variants such as erstatningspersonnumer ("substitute CPR-nummer").
These numbers encode the date of birth and gender. This library implement their semantics. It correctly determines the year of birth based on the two (least significant) year digits in the CPR-nummer and extra information encoded in the control digits.
The CPR-nummer is encoded to enable validation of correct entry (modulus control). This is implemented by the library.
The CPR-nummer is considered personal information. Therefore the library defaults to not printing the number in .ToString()
to reduce the risk of accidentally leaking sensitive personal information into e.g. log files.
Note that citizens might obtain a new CPR-number, for example when they try to change their gender surgically. Hence it is a good idea to model it as a temporal attribute on a person. Do not use it as a key.
The CPR-number is classified as sensitive in GDPR (da.: "personfølsom oplysning").
Private companies may use of the CPR-nummer as regulated by Danish law:
Private virksomheders anvendelse af personnummer er reguleret i § 11, stk. 2 i lov om behandling af personoplysninger (persondataloven).
Source: CPR.dk FAQ
You can read the legislation in Retsinformation: Lov om behandling af personoplysninger LOV nr 429 af 31/05/2000.
Copyright (c) 2020 Martin Jul. This library is licensed under the MIT License. See the LICENSE file for details.