is-valid-fodselsnummer
v4.0.0
Published
Check if input is a valid national identification number of Norway
Downloads
517
Maintainers
Readme
is-valid-fodselsnummer
Check if supplied input is valid fødselsnummer (Norwegian national identification number).
Identify if number is an F or D-number
Installation
From npm
$ npm i --save is-valid-fodselsnummer
From GitHub
$ git clone https://github.com/zrrrzzt/is-valid-fodselsnummer.git
cd into directory and install dependencies
$ npm run setup
Usage validation
const isValidFodselsnummer = require('is-valid-fodselsnummer')
isValidFodselsnummer('01010750160')
// => true
isValidFodselsnummer('12341234567')
// => false
Usage identification
const isValidFodselsnummer = require('is-valid-fodselsnummer')
isValidFodselsnummer('01010750160', true)
// => F
isValidFodselsnummer('41085801188', true)
// => D
isValidFodselsnummer('12341234567', true)
// => false
Related
- is-valid-fodselsnummer-cli CLI version of this module