npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hetugen

v1.0.1

Published

A package for generating Finnish ids

Downloads

981

Readme

Finnish Social Security Number (SSN) Generator

This is a small Javascript library for generating valid Finnish SSN. The logic is based on Tuomas Salste's quality article: https://www.tuomas.salste.net/doc/hetu/tunnus.html.

This generator will not generate SSNs from before 1900 nor from the future. (min = 1900, max = current year)

Finnish SSN has the following format: ddmmyy-XXXT Where ddmmyy is the birthdate and XXX is a rolling number used to differentiate people born on the same day and T is a checksum to ensure that the ssn has been validly generated. (Also the last X in the XXX differentiates between male and females but that is not something that this generator takes into account.)

NB: The Finnish SSN system has two types of SSNs. Actual SSNs which can be given to people and are registered in Väestörekisteri (Finnish people registry) and temporary SSNs which are used for testing purposes and in the past were given to babies before the actual SSN was generated. Actual SSNs have the identification (the XXX in the ddmmyy-XXXT) part be in the format of 000-899 and temporary ones have the format of 900-999. As actual SSNs can be someone's actual SSN, it is not recommended to use these SSNs for any testing purposes. That's why the generator by default generates an temporary SSN.

How to use

const Hetugen = require('hetugen');

// generates a single temporary ssn
console.log(Hetugen.generate())

// generates a single temporary ssn
console.log(Hetugen.generateSingleTemporary());

// generates a single actual ssn
console.log(Hetugen.generateSingleActual());

// returns array of n ssns, 
const isActual = true
console.log(Hetugen.generateN(5, isActual))


Releases

  • 1.0.1
    • dependencies updated
  • 1.0.0
    • First stable release
  • 0.9.0
    • Should generate valid ssns.
    • Should be able to validate ssns
  • 0.3.0
    • fixed validation
    • fixed a bug generation
    • optimized and cleaned code
  • 0.2.1 Minor release
    • fixed dependencies
  • 0.2.0 Second release
    • Fixes a bug where the checksum is incorrectly generated
    • Improves validation to actually check for a correct checksum
  • 0.1.0 First working release