import random
class IDGenerator:
@classmethod
def gen_primary_id(cls, length=11):
prefix = random.choice('123456789')
return prefix + ''.join([random.choice('0123456789')
for i in range(length)])
据说系统运行了几年,没碰见过碰撞的情况。我感觉我数学没学好,谁能告诉我这是哪一块的知识
101
flyingghost 2021-04-28 11:11:56 +08:00
“只要我碰撞几率足够小,就没有人敢当面说我不好用!”
——by git(SHA1) |