1
0
mirror of synced 2025-12-22 04:58:01 +08:00

统一输入为bigint类型

This commit is contained in:
zhupengfei
2021-10-25 15:59:29 +08:00
parent 21e30e55da
commit d8d8714eaf
4 changed files with 37 additions and 16 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() {