1
0
mirror of synced 2025-12-20 12:08:02 +08:00

feat: python m1版id生成器

This commit is contained in:
koukouchan
2022-08-07 16:33:59 +08:00
parent 1fb780d634
commit d3c795e3b7
8 changed files with 183 additions and 42 deletions

18
Python/test.py Normal file
View File

@@ -0,0 +1,18 @@
from source import Options,Generator
if __name__ == '__main__':
try:
options = Options.IdGeneratorOptions(workerId=23,seqBitLength=10)
options.BaseTime = 1231111111
idgen = Generator.DefaultIdGenerator()
idgen.SetIdGernerator(options)
uid = idgen.NextId()
print(uid)
print(options.__dict__)
except ValueError as e:
print(e)