2.1.7 • Published 4 years ago

egg-cute-snowflake v2.1.7

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

egg-cute-snowflake

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-cute-snowflake --save

Usage

// {app_root}/config/plugin.js
exports.snowflake = {
  enable: true,
  package: 'egg-cute-snowflake',
};

Configuration

JAVA 64bit

config.snowflake = {
  app: true,
  agent: true,
  client: {
    twepoch: 1480166465631,
    dataCenterIdBits: 5,
    workerIdBits: 5,
    sequenceBits: 12,
  },
};

Return a 64bit string, for example '553211427826962432'
  
JS 53bit

config.snowflake = {
  app: true,
  agent: true,
  client: {
    twepoch: 1480166465631,
    dataCenterIdBits: 3,
    workerIdBits: 3,
    sequenceBits: 6,
  },
};

Return a 53bit number, for example '540245822818368'

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

2.1.7

4 years ago

2.1.5

4 years ago

2.1.4

4 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.1.2

5 years ago

1.0.0

5 years ago