Particle

2.2.1 • Public • Published

Build Status codecov.io

NPM

Particle

Language: JavaScript

64bits int Time Based ID Generator

JavaScript implementation of Twitter Snowflake ID Generator

Uncoordinated

For high availability within and across data centers, machines generating ids should not have to coordinate with each other.

Solution

  • id (64 bits) is composed of:
    • time - 42 bits (millisecond precision w/ a custom epoch)
    • configured machine id - 10 bits - up to 1024 machines
    • sequence number - 12 bits - up to 4096 random numbers

System Clock Dependency

You should use NTP to keep your system clock accurate.

How to use it

Check Demo

Readme

Keywords

none

Package Sidebar

Install

npm i Particle

Weekly Downloads

4

Version

2.2.1

License

LICENSE.md

Last publish

Collaborators

  • sschiau