https://github.com/tflanagan/node-flake-id
Generate 64-Bit (with 63 signigicant bits) k-ordered, conflict-free ids in a distributed environment.
https://github.com/tflanagan/node-flake-id
Last synced: 11 months ago
JSON representation
Generate 64-Bit (with 63 signigicant bits) k-ordered, conflict-free ids in a distributed environment.
- Host: GitHub
- URL: https://github.com/tflanagan/node-flake-id
- Owner: tflanagan
- License: other
- Created: 2017-11-14T02:20:53.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-14T02:23:13.000Z (about 8 years ago)
- Last Synced: 2025-02-24T01:03:12.411Z (11 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Flake ID
========
Generate 64-Bit (with 63 signigicant bits) k-ordered, conflict-free ids in a distributed environment.
## Installation
`$ npm install --save git@gitlab.tristianflanagan.com:node-portal/flake-id.git`
## Usage
```js
const FlakeId = require('flake-id');
const flakeid = new FlakeId({
epoch: 0,
worker: 0,
datacenter: 0,
seqMask: 0xFFF
});
flakeid.get();
//
```
Returns a [Buffer](https://nodejs.org/api/buffer.html) object