npm.io
0.1.3 • Published 3 years ago

superflake

Licence
Apache-2.0
Version
0.1.3
Deps
0
Size
15 kB
Vulns
0
Weekly
0

Superflake

official-product-badge

Superflake is a revolutionary technology based on Twitter's Snowflake created with TypeScript.

Superflake is generated by concatenating:

  • a 42-bit timestamp,
  • a 10-bit node ID, and
  • a 12-bit sequential number.

By the way, Superflake's default epoch is 1616275800 (March 20, 2021).

Installation

npm i superflake

Example

import Superflake from 'superflake'

let flake = new Superflake({ nodeId: 1 }).gen()
// => 6925192012375265280

Keywords