生成uuid

import shortuuid
def get_unique_id():
    su = shortuuid.ShortUUID(alphabet="0123456789")
    _id = int(su.random(length=19))
    return _id

 

 

19 位的guid

import shortuuid
def get_unique_id():
    su = shortuuid.ShortUUID(alphabet="0123456789")
    _id = int(su.random(length=19))
    if 1000000000000000000 < _id < 9223372036854775807:
        return _id
    return get_unique_id()

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-03-09
  • 2022-12-23
  • 2021-11-03
  • 2021-07-29
  • 2022-12-23
相关资源
相似解决方案