1、网上例子:
https://blog.csdn.net/zheng2780071070/article/details/107692978
https://www.cnblogs.com/haiyan123/p/9752813.html
https://www.cnblogs.com/franknihao/p/7307224.html
自己写得测试代码:
取uuid的前16字符,生产的字符串,也不重复。
import time
import uuid
us = 0
set1 = set()
for i in range(100000):
print(str(uuid.uuid1()).replace("-", “”))
print(str(uuid.uuid1()).replace("-", “”)[:16])
set1.add(str(uuid.uuid1()).replace("-", “”)[:16])
us += 1
print(“us=”, us)
print(len(set1))