cherry-id
该代码参考 go 版本,需要 Nodejs 或者浏览器支持 BigInt
。基本参数与 go 版本一致,只要,但是只实现了雪花飘移算法,没有传统的雪花算法,所以Method
参数并没有作用。
使用
const GenId = require("./index.js")
const genid = new GenId({ WorkerId: 1 });
for (let index = 0; index < 5000; index++) {
console.log(genid.NextId());
}