Skip to content

ioxo/node-fin-id

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Finnish Identity Number Library

Description

This library is a collection of functions dealing with finnish specific identification numbers.

Features

  • hetu -- Check finnish HETU numbers

Installation for Node.js

Simplest way to install is to use npm, just simply npm install fin-id.

Authors

License

MIT-style license, see INSTALL.txt.

Initializing

Each feature is a property:

var hetu = require('fin-id').hetu;

See examples/ for full examples.

Hetu

The call hetu.check(hetu) returns true if the argument is valid ID:

if(hetu.check('010171-1234')) console.log("valid");
else console.log("invalid");

The call hetu.parse(hetu) returns an object with additional information:

var parsed = hetu.parse('010171-1234');
if(parsed) {
	console.log("birthday is " + parsed.date());  // Fri, 01 Jan 1971
	console.log("sex is " + parsed.sex());        // 'female'
}

TODO

About

Finland Identity Number Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%