niho/personal-number/1.1.0

NOTE: the latest version is 1.2.1

PersonalNumber.Norwegian

Parse Norwegian personal numbers.

Definition

An opaque type representing a valid personal number.

Errors

= InvalidFormat
| InvalidLength
| InvalidDate
| InvalidChecksum

If the parsing fails an error of this type is returned.

Strings

Parse a string into a personal number.

Converts a personal number to string representation in the long format that is commonly used for database storage (DDMMYYXXXCC).

Format a personal number into a user readable string (DDMMYY-XXX-CC).

JSON

Decode a personal number.

Encode a personal number into a JSON value.