Skip to content
This repository was archived by the owner on Jul 8, 2024. It is now read-only.

A Node.js module that generates unique ID values similar to the way Twitter's Snowflake works

Notifications You must be signed in to change notification settings

klout/genidmod-for-nodejs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

GenIDMod.js

This is a Node.js library that generates a unique numeric ID. It uses the time in microseconds and a counter to cater for sub-millisecond accesses. These are joined to form a value that is passed back in json format.

It is similar in concept to Twitter's Snowflake project. Just a lot less code and more limitations. It cannot run on more than one server instance, but it can handle 4096 iterations within a single millisecond with rollover protection.

##Distributed mode Unique instance ID (0-63) can be used.

About

A Node.js module that generates unique ID values similar to the way Twitter's Snowflake works

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%