1
0
mirror of synced 2026-04-18 22:38:41 +08:00

auto commit

This commit is contained in:
yitter
2021-06-28 16:40:23 +08:00
parent c922a45935
commit 3cd83f7dbf
6 changed files with 0 additions and 0 deletions

26
Node.js/README.md Normal file
View File

@@ -0,0 +1,26 @@
<!--
* @description: README
* @author: bubao
* @date: 2021-04-28 09:52:24
* @last author: bubao
* @last edit time: 2021-04-28 10:34:31
-->
# cherry-id
[![NPM version](https://img.shields.io/npm/v/cherry-id.svg)](https://www.npmjs.com/package/cherry-id) [![jaywcjlove/sb](https://jaywcjlove.github.io/sb/lang/english.svg)](README.md)
该代码参考 go 版本,需要 Nodejs 或者浏览器支持 `BigInt`。基本参数与 go 版本一致,只要,但是只实现了雪花飘移算法,没有传统的雪花算法,所以`Method`参数并没有作用。
## 使用
```js
const GenId = require("./index.js")
const genid = new GenId({ WorkerId: 1 });
for (let index = 0; index < 5000; index++) {
console.log(genid.NextId());
}
```