1
0
mirror of synced 2025-12-17 18:48:09 +08:00
Files
SnowFlake-IdGenerator/JavaScript
bonn 91459b1538 修复_IsOverCost参数错误的问题,解决bigint的问题,增加demo (#18)
* 修改demo程序的一个错误

* 修正demo上一个错误

* 修复_IsOverCost参数错误的问题,解决bigint的问题,增加demo

* 统一输入为bigint类型

* 增加测试demo

* Update README.md

Co-authored-by: yitter <80446528+yitter@users.noreply.github.com>
2021-10-27 11:54:38 +08:00
..
2021-08-31 11:52:53 +08:00
2021-08-31 11:52:53 +08:00
2021-08-31 11:52:53 +08:00
2021-09-02 11:53:04 +08:00

❄ idgenerator-JavaScript

介绍

项目更多介绍参照:https://github.com/yitter/idgenerator

代码贡献者bubao 布宝

执行测试代码

node test/test2.js

使用

const GenId = require("./index.js")
const genid = new GenId({ WorkerId: 1 });

for (let index = 0; index < 5000; index++) {
    console.log(genid.NextId());
}

其他帮助

在mysql中int类型最大长度是10位数字由于本算法默认生成的是15位最短也是11位所以在mysql中需要使用bigint数据类型