Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inductivecomputerscience/fodselsnummer
A library for computations on Norwegian Personal Identification numbers (fodselsnummer)
https://github.com/inductivecomputerscience/fodselsnummer
Last synced: 8 days ago
JSON representation
A library for computations on Norwegian Personal Identification numbers (fodselsnummer)
- Host: GitHub
- URL: https://github.com/inductivecomputerscience/fodselsnummer
- Owner: InductiveComputerScience
- License: mit
- Created: 2018-08-21T13:25:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-16T10:58:27.000Z (11 months ago)
- Last Synced: 2024-01-16T17:11:23.034Z (11 months ago)
- Language: C
- Size: 122 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fodelsnummer or Fødselsnummer
This project contains a library for computations (validation and birth date extraction) on Norwegian Personal Identification Numbers in many programming languages. The library works exactly the same in all implementations:* Java
* C
* C++
* JavaScript
* C#
* PHP
* Python
* Visual BasicNorwegian Personal Identification Numbers is called fodelsnummer or fødselsnummer in norwegian.
The library has been made with [progsbase](https://www.progsbase.com), a tool for creating rot-resistant programs that are translatable to many programming languages.
The library can also be browsed and tested on the [progsbase repository's fodselsnummer page](https://repo.progsbase.com/repoviewer/no.inductive.libraries/foedselsnummer/0.2.2).
![progsbase logo](/docs/images/progsbase-logo.png)
For more information about progsbase, check out: [progsbase.com](https://www.progsbase.com).
## Usage
The library has the same interface in all programming languages.
### Validate
`boolean isValidNorwegianPersonalIdentificationNumber(char [] fnummer, StringReference message)`The function takes two inputs: a string, containing a norwegian personal identification number, and a string reference, that will get an error message.
The output is a boolean, true if the number is valid and false if not. If the return is false, message is set to a string explaining the reason.
### Extract Birth Date
`boolean GetDateFromNorwegianPersonalIdentificationNumber(char[] fnummer, DateReference dateRef, StringReference message)`The function takes a string as input, containing a norwegian personal identification number, a reference to a date and a reference to a string.
The function returns true if successfull and false if not.
If the function succeeds, the date in the date reference is set with three fields: year, month, day.
If the function fails, the string reference message gets an error message.