uuid.uuid1()返回非常相似的结果[重复](uuid.uuid1() returns pretty similar results [duplicate])

编程入门 行业动态 更新时间:2024-10-07 10:15:27
uuid.uuid1()返回非常相似的结果[重复](uuid.uuid1() returns pretty similar results [duplicate])

这个问题在这里已有答案:

使用哪个UUID版本? 4个答案

我在Python中用uuid.uuid1()生成了uuid,它们看起来非常相似。 这是为什么? 如何将它们随机化?

This question already has an answer here:

Which UUID version to use? 4 answers

I've generated uuid's by uuid.uuid1() in Python and they all look pretty similar. Why is that? How to randomize them?

最满意答案

这是因为uuid1是根据您的机器ID和时间戳生成的,并且您的机器中的机器ID保持不变,这就是为什么它们在最后看起来非常相似。 您可以使用uuid4()来获取随机唯一的uuid 。

That is because the uuid1 is generated from your machine ID and time stamp and the machine ID in your case remains constant, that's why they look pretty similar at the end. You may use uuid4() to get a random unique uuid.

更多推荐

本文发布于:2023-07-27 04:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1284880.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:returns   uuid   pretty   duplicate   results

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!