什么是UUID?

发布于 2024-07-09 10:02:53 字数 14 浏览 14 评论 0原文

嗯,什么是一?

Well, what is one?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

笑咖 2024-07-16 10:02:53

它是唯一标识某物的标识号。 这个想法是 ID 号将普遍是唯一的。 因此,任何两个事物都不应该具有相同的 uuid。 事实上,如果您要生成 10 万亿个 uuid,则两个 uuid 相同的概率为 0.00000006。

It's an identification number that will uniquely identify something. The idea being that id number will be universally unique. Thus, no two things should have the same uuid. In fact, if you were to generate 10 trillion uuids, there would be something along the lines of a .00000006 chance of two uuids being the same.

你另情深 2024-07-16 10:02:53

标准化标识符

UUIDRFC 4122。 它们是通用唯一标识符,无需使用集中机构即可生成。 UUID 有四种主要类型,它们的使用场景略有不同。 所有 UUID 的长度均为 128 位,但通常表示为由四个连字符分隔的 32 个十六进制字符。

最常见的版本 1 UUID 结合了 MAC 地址和时间戳以产生足够的唯一性。 如果多个 UUID 的生成速度足够快,以至于时间戳在下一代之前不会递增,则时间戳将手动递增 1。如果没有可用的 MAC 地址,或者出于隐私原因不希望存在 MAC 地址,则 6 个随机数源自加密安全随机数生成器的字节可以替代地用于节点 ID。

版本 3 和版本 5 UUID 最不常见,分别使用 MD5 和 SHA1 哈希函数,加上命名空间,加上已经唯一的数据值来生成唯一 ID。 例如,这可用于从 URL 生成 UUID。

版本 4 UUID 只是 128 位随机数据​​,通过一些位调整来识别 UUID 版本和变体。

UUID 冲突不可能发生,尤其是在单个应用程序空间中。

Standardized identifiers

UUIDs are defined in RFC 4122. They're Universally Unique IDentifiers, that can be generated without the use of a centralized authority. There are four major types of UUIDs which are used in slightly different scenarios. All UUIDs are 128 bits in length, but are commonly represented as 32 hexadecimal characters separated by four hyphens.

Version 1 UUIDs, the most common, combine a MAC address and a timestamp to produce sufficient uniqueness. In the event of multiple UUIDs being generated fast enough that the timestamp doesn't increment before the next generation, the timestamp is manually incremented by 1. If no MAC address is available, or if its presence would be undesirable for privacy reasons, 6 random bytes sourced from a cryptographically secure random number generator may be used for the node ID instead.

Version 3 and Version 5 UUIDs, the least common, use the MD5 and SHA1 hash functions respectively, plus a namespace, plus an already unique data value to produce a unique ID. This can be used to generate a UUID from a URL for example.

Version 4 UUIDs, are simply 128 bits of random data, with some bit-twiddling to identify the UUID version and variant.

UUID collisions are extremely unlikely to happen, especially not in a single application space.

瑶笙 2024-07-16 10:02:53

UUID 代表通用唯一标识符
它是一个 128 位值,用于软件开发中的唯一标识。 UUID 与 GUID (Microsoft) 相同,是分布式计算环境 (DCE) 的一部分,由开放软件基金会 (OSF) 标准化。

如前所述,它们在空间和时间上具有很高的唯一性,并且在计算上很难猜测。 它的生成基于当前时间戳和生成 UUID 的工作站的唯一属性。

输入图像描述这里
图片来自 https://segment.com/blog/a-brief- uuid 的历史记录/

UUID stands for Universally Unique IDentifier.
It's a 128-bit value used for a unique identification in software development. UUID is the same as GUID (Microsoft) and is part of the Distributed Computing Environment (DCE), standardized by the Open Software Foundation (OSF).

As mentioned, they are intended to have a high likelihood of uniqueness over space and time and are computationally difficult to guess. It's generation is based on the current timestamp and the unique property of the workstation that generated the UUID.

enter image description here
Image from https://segment.com/blog/a-brief-history-of-the-uuid/

ㄟ。诗瑗 2024-07-16 10:02:53

它是一串非常长的位,现在和永远都是唯一的,即不可能与您或世界上任何其他人生成的任何其他 UUID 发生冲突。

它的工作方式只是使用当前时间戳以及生成它的计算机的与互联网相关的唯一属性(例如 IP 地址,在您连接到互联网时应该是唯一的;或者 MAC 地址,它应该是唯一的)。是更低级别的,是网卡的硬连线 ID)是位串的一部分。

本来世界上每块网卡都有自己唯一的MAC地址,但在后来的世代中,你可以通过软件改变MAC地址,所以它不再像唯一的ID那么可靠。

It's a very long string of bits that is supposed to be unique now and forever, i.e. no possible clash with any other UUID produced by you or anybody else in the world .

The way it works is simply using current timestamp, and an internet related unique property of the computer that generated it (like the IP address, which ought to be unique at the moment you're connected to the internet; or the MAC address, which is more low level, a hard-wired ID for your network card) is part of the bit string.

Originally every network card in the world has its own unique MAC address, but in later generations, you can change the MAC address through software, so it's not as much reliable as a unique ID anymore.

海未深 2024-07-16 10:02:53

UUID 是一个 128 位数字,用于唯一标识某个实体。 根据所使用的具体机制,UUID 保证与生成的任何其他 UUID 不同,或者至少极有可能不同。 UUID 依赖于组件的组合来确保唯一性。 UUID 包含对生成 UUID 的主机的网络地址的引用、时间戳和随机生成的组件。 由于网络地址标识唯一的计算机,并且时间戳对于从特定主机生成的每个 UUID 是唯一的,因此这两个组件应充分确保唯一性。

A UUID is a 128-bit number that is used to uniquely identify some entity. Depending on the specific mechanisms used, a UUID is guaranteed to be different or is, at least, extremely likely to be different from any other UUID generated. The UUID relies upon a combination of components to ensure uniqueness. A UUID contains a reference to the network address of the host that generated the UUID, a timestamp and a randomly generated component. Because the network address identifies a unique computer, and the timestamp is unique for each UUID generated from a particular host, those two components should sufficiently ensure uniqueness.

遮云壑 2024-07-16 10:02:53

我只是想补充一点,最好使用 usUUID(静态窗口标识符)。
例如,如果计算机用户依赖第三方软件(例如盲人或弱视用户的屏幕阅读器),则其他软件(在本例中为屏幕渲染器)将通过唯一标识符发挥更好的效果!
毕竟,如果有人在你知道你把车停在哪里后移动你的车,你会多么高兴!

I just want to add that it is better to use usUUID (Static windows identifiers).
For example if a computer user that relies, on a third party software like a screen reader for blind or low vision users, the other software (in this case the screen reder) will play better with unique identifiers!
After all how happy will you be if someone moves your car after you know the place you parked it at!!!

我一向站在原地 2024-07-16 10:02:53

通用唯一标识符 (UUID) 是一个 128 位数字,用于识别计算机系统中的信息。 术语“全局唯一标识符”(GUID) 也被使用,通常用在 Microsoft 创建的软件中。
当根据标准方法生成时,UUID 在实际用途上是唯一的。 与大多数其他编号方案不同,它们的独特性并不依赖于中央注册机构或生成它们的各方之间的协调。 而 UUID 重复的概率。

A universally unique identifier (UUID) is a 128-bit number used to identify information in computer systems. The term globally unique identifier (GUID) is also used, typically in software created by Microsoft.
When generated according to the standard methods, UUIDs are for practical purposes unique. Their uniqueness does not depend on a central registration authority or coordination between the parties generating them, unlike most other numbering schemes. While the probability that a UUID will be duplicate.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文