Jump to content

Talk:Universally unique identifier: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
m Archiving 1 discussion(s) to Talk:Universally unique identifier/Archive 1) (bot
Tags: Reverted Mobile edit Mobile app edit Android app edit
Line 30: Line 30:


[[User:Alexgenaud|Alexgenaud]] ([[User talk:Alexgenaud|talk]]) 11:20, 9 November 2022 (UTC)
[[User:Alexgenaud|Alexgenaud]] ([[User talk:Alexgenaud|talk]]) 11:20, 9 November 2022 (UTC)

:[[User:Alexgenaud|@Alexgenaud]] [[Special:Contributions/69.194.106.123|69.194.106.123]] ([[User talk:69.194.106.123|talk]]) 01:09, 15 April 2023 (UTC)


== What are the different variants of Version 4 UUID's used for? ==
== What are the different variants of Version 4 UUID's used for? ==

Revision as of 01:09, 15 April 2023

Variants 1 and 2 confusion

Several distinctions in the main article seem to be backward (and comments below tend to confirm suspicion). For example, the main article claims that variant 1, aka Leach-Salz, are most common. I believe it is in fact variant 2, aka Leach-Salz, that are most common. For example:

Java UUID documentation, several times refers to variant 2 as the "Leach-Salz" variant, such as: "The layout of a variant 2 (Leach-Salz) UUID is as follows" and "valid only for a UUID with a variant value of 2, which indicates the Leach-Salz variant".

https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/UUID.html

Java's standard UUID.randomUUID() factory method returns version 4, variant 2 by default (as tested and proven).

It is stated that variants 1 vs 2 are distinguished by endian-ness. The article also claims that these distinctions are lost in textual representation (that variant 1 and 2 are the same as text). These may be correct assertions, but of course, one must be sceptical.

I could imagine these inaccuracies may have been introduced when merging the UUID and GUID articles. It may be that variant 1 was the most common GUID and variant 2 is the most common UUID (maybe), yet we now pretend that both UUID and GUID are the same (with different variants and versions).

Alexgenaud (talk) 11:20, 9 November 2022 (UTC)[reply]

@Alexgenaud 69.194.106.123 (talk) 01:09, 15 April 2023 (UTC)[reply]

What are the different variants of Version 4 UUID's used for?

From what I can determine, Version 4 UUID's -- the random kind -- have four variants, signified by the 17th hex digit being one of "8", "9", " a", or "b" (which is how I will refer to each variant here).

What are these four different variants for? How are they used? What determines the use of (say) variant "a" rather than variant "8"?

I'm writing a program to generate these UUID's pseudorandomly, and I don't want to make some kind of ghastly error by providing the wrong type of UUID! Is there a reason why one would use one v4 variant and not another? Are some v4 variants more apprpriate for some uses, and others for other uses? The ONLY document I've yet come across that addresses this issue says (in relevant part):

"...Version-4, variant-1 UUIDs are used in the game Minecraft... Version-4, variant-2 is called a "GUID" on Microsoft systems..." (Source: https://www.uuidtools.com/uuid-versions-explained, Retrieved: Fri., 30-Sep-2022 at 08:43:17pm -0400 UTC.)

However, this leaves unanswered qustions. First (and most obvious) is, what about variants 3 and 4 (what I call "a" and "b" above)?

Also, the phrases "are used in" and "is called a" don't tell me whether these variants are exclusively reserved for these uses, or if it is permitted to use them for other, additional, purposes as well.

The main Wikipedia article doesn't even remotely begin to even touch upon this question...

Guidance? Help? Please?

Variant 2 UUID and COM/OLE

This page states:

"Variant 2 UUIDs, historically used in Microsoft's COM/OLE libraries, use a mixed-endian format, whereby the first three components of the UUID are little-endian, and the last two are big-endian."

But blog post from Microsoft engineer Raymond Chen https://devblogs.microsoft.com/oldnewthing/20220928-00/?p=107221 states:

"No, it is little-endian all the way. But if you don’t understand how GUIDs are formed, it might look like some parts are big-endian."

Wongm (talk) 03:27, 31 October 2022 (UTC)[reply]