1
0
mirror of synced 2025-12-17 18:48:09 +08:00

修复_IsOverCost参数错误的问题,解决bigint的问题,增加demo (#18)

* 修改demo程序的一个错误

* 修正demo上一个错误

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

* 统一输入为bigint类型

* 增加测试demo

* Update README.md

Co-authored-by: yitter <80446528+yitter@users.noreply.github.com>
This commit is contained in:
bonn
2021-10-27 11:54:38 +08:00
committed by GitHub
parent c8ca844ce6
commit 91459b1538
7 changed files with 199 additions and 17 deletions

View File

@@ -8,10 +8,11 @@ function test1() {
}
}
function test2() {
const genid = new GenId({ WorkerId: 1 })
const id = genid.NextId()
console.log(typeof (id))
console.log(id, id.toString().length)
const genid = new GenId({ WorkerId: 1, SeqBitLength: 14 })
for (let i = 0; i < 10; i++) {
let id1 = genid.NextId()
console.log(`${i} ID:${id1} ${typeof id1} 长度:${id1.toString().length}`)
}
}
function main() {