17 lines
285 B
Python
17 lines
285 B
Python
import uuid
|
|
import time
|
|
|
|
|
|
d = dict()
|
|
n = 0
|
|
for i in range(1000000):
|
|
now_time = str(time.time())
|
|
id = str(uuid.uuid4())[:6]+now_time
|
|
if id in d:
|
|
print(id)
|
|
n += 1
|
|
else:
|
|
d[id] = 1
|
|
print(id)
|
|
print(f'总共有 {n} 个重复的 uuid')
|