social-number-de

1.2.1 • Public • Published

Maintainability

What is this?

social-number-de is a german Social Number (https://de.wikipedia.org/wiki/Sozialversicherungsnummer) parser and generator for the Browser and Node.js.

Installation

npm install social-number-de

Introduce Class

import { SocialNumberDe } from  'social-number-de';

  

const  sin  =  new  SocialNumberDe();

Parsing

Use the .isValid() to determine Social Number validity.

import { SocialNumberDe } from  'social-number-de';

  

const  sin  =  new  SocialNumberDe();

sin.isValid("55347124W504");

// Returns: true

  

sin.isValid("55347124W502");

// Returns: false

Generating

Use the .getRandomID() class method to generate a valid random Social Number.

sin.getRandomID()

// Returns a random SIN, e.g. "49973455Z450"

inspired by wealthsimple/social-insurance-number

Supported by

Package Sidebar

Install

npm i social-number-de

Weekly Downloads

1

Version

1.2.1

License

MIT

Unpacked Size

8.29 kB

Total Files

7

Last publish

Collaborators

  • jnnk