You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 548 B

3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
12345678910111213141516171819202122232425262728
  1. # ❄ idgenerator-JavaScript
  2. ## 介绍
  3. 项目更多介绍参照:https://github.com/yitter/idgenerator
  4. 代码贡献者:bubao 布宝
  5. 执行测试代码
  6. ```bash
  7. node test/test2.js
  8. ```
  9. ## 使用
  10. ```js
  11. const GenId = require("./index.js")
  12. const genid = new GenId({ WorkerId: 1 });
  13. for (let index = 0; index < 5000; index++) {
  14. console.log(genid.NextId());
  15. }
  16. ```
  17. ## 其他帮助
  18. 在mysql中int类型最大长度是10位数字,由于本算法默认生成的是15位,最短也是11位,所以在mysql中需要使用bigint数据类型