首页 > 解决方案 > Does Swift Foundation's UUID incorporate the time by default?

问题描述

Does the Swift UUID type take into account the time it was created to help guarantee its uniqueness or is it purely random? If not, is there a version that does?

标签: swiftuuidfoundation

解决方案


我引用文档

使用 RFC 4122 版本 4 随机字节初始化新的 UUID。

所以它完全是随机的。已经有一篇文章描述了如何在此处创建基于时间的 UUID 。


推荐阅读