flake-id
v0.1.1
Published
Generate 64-Bit (with 63 signigicant bits) k-ordered, conflict-free ids in a distributed environment.
Downloads
1
Readme
Flake ID
Generate 64-Bit (with 63 signigicant bits) k-ordered, conflict-free ids in a distributed environment.
Installation
$ npm install --save [email protected]:node-portal/flake-id.git
Usage
const FlakeId = require('flake-id');
const flakeid = new FlakeId({
epoch: 0,
worker: 0,
datacenter: 0,
seqMask: 0xFFF
});
flakeid.get();
// <Buffer 2b 35 05 94 a1 80 00 00>
Returns a Buffer object