1
0
mirror of synced 2025-12-15 01:28:09 +08:00
Files
SnowFlake-IdGenerator/JavaScript/README.md
2021-09-02 11:53:04 +08:00

29 lines
548 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ❄ idgenerator-JavaScript
## 介绍
项目更多介绍参照https://github.com/yitter/idgenerator
代码贡献者bubao 布宝
执行测试代码
```bash
node test/test2.js
```
## 使用
```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数据类型