Skip to content

YoannMa/nir-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nir-generator

A tool to generate a random NIR number (https://fr.wikipedia.org/wiki/Numéro_de_sécurité_sociale_en_France)

Installation

npm install --save nir-generator

Usage

// import
const nirGenerator = require('nir-generator');


// use
let myNIR = nirGenerator.generateNir();

// following the wiki, there is 3 'type' of NIR number :

myNIR = nirGenerator.generateNirTypeA();

myNIR = nirGenerator.generateNirTypeB();

myNIR = nirGenerator.generateNirTypeC();

// You can validate a NIR using

if ( myNIR.match(nirGenerator.nirRegex) ) {
    // valid
}

About

A tool to generate a NIR

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published