码迷,mamicode.com
首页 > 编程语言 > 详细

python模块uuid产生唯一id

时间:2019-01-12 00:27:22      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:promise   work   cut   tle   put   随机数   code   call   nbsp   

 

使用版本4:uuid4就可以了

UUID4缺点:糟糕的随机数发生器使得它更有可能发生碰撞,但是概率真的很小

UUID1缺点:暴露隐私

 

If all you want is a unique ID, you should probably call uuid1() or uuid4(). Note that uuid1() may compromise privacy since it creates a UUID containing the computer’s network address. uuid4()creates a random UUID.

 

参考:https://docs.python.org/3.8/library/uuid.html

https://pythoncaff.com/docs/pymotw/uuid-universally-unique-identifiers/156

python模块uuid产生唯一id

标签:promise   work   cut   tle   put   随机数   code   call   nbsp   

原文地址:https://www.cnblogs.com/shengulong/p/10258158.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!