twitter-snowflake-utils

1.0.1 • Public • Published

twitter-snowflake-utils

Utilities for working with Twitter's snowflake algorithm
🐦❄️🛠

$ npm i twitter-snowflake-utils

Usage

import { generateId, getComponents } from 'twitter-snowflake-utils';
 
getComponents('1101668899018334209');
// > { creationTime: '1551493308201',
//     dataCenterId: '10',
//     machineId: '22',
//     sequenceId: '1',
//     workerId: '342' }
 
generateId('1551493308201', '342', '1');
// > '1101668899018334209'

Authors

Readme

Keywords

none

Package Sidebar

Install

npm i twitter-snowflake-utils

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

5.3 kB

Total Files

6

Last publish

Collaborators

  • colingourlay