You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test.py 351 B

123456789101112131415161718
  1. from source import Options,Generator
  2. if __name__ == '__main__':
  3. try:
  4. options = Options.IdGeneratorOptions(workerId=23,seqBitLength=10)
  5. options.BaseTime = 1231111111
  6. idgen = Generator.DefaultIdGenerator()
  7. idgen.SetIdGernerator(options)
  8. uid = idgen.NextId()
  9. print(uid)
  10. print(options.__dict__)
  11. except ValueError as e:
  12. print(e)