News for hackers. Stuff that matters.
Re:You Don't Need UUID by AdamH12113 on Monday September 11, 2023 @01:48PM (#37470867)
> Does it make the URL in the URL bar longer? Yeah, but does that matter?

I appreciate shorter URLs any time I copy and paste them, which always involves looking at them and sometimes involves scrolling to the end to remove tracking- and search-related fluff.

128 bits is an absurd amount for a unique ID within a single system. Even 48 bits is very, very large -- enough to provide a unique ID (MAC address) to every Ethernet device made for something like 100 years.

The purpose of a UUID is to provide a negligible probability of collisions between randomly-generated IDs in a global space forever. Almost no applications require that, so most of the time using a UUID is just needlessly taking up space.

Re:You Don't Need UUID by siva7 on Monday September 11, 2023 @02:03PM (#37471085)
That’s not the only major purpose for a UUID and even if it was, it still would be flat out wrong to claim that almost no application requires that.
Re:You Don't Need UUID by AdamH12113 on Monday September 11, 2023 @03:43PM (#37472608)
Maybe I'm missing something, then? I'm having trouble thinking of applications where it seems like a good idea to generate a permanent ID number completely randomly at all, much less applications that need to let the whole world do so. I can see how Windows device drivers have that requirement, but the point of the article is that even a massive site like YouTube (which doesn't want videos to be randomly discoverable via URL manipulation) does not need anywhere close to 128 bits. What are these applications you speak of?
Re:You Don't Need UUID by paulddraper on Tuesday September 12, 2023 @03:55PM (#37487144)
The purpose of a universally unique identifier was indeed to be universally unique.
Re:You Don't Need UUID by hot_gril on Monday September 11, 2023 @02:46PM (#37471807)
Basically, you want UUID's 122 bits (128 minus 6 wasted on variant + version) if you can't afford collisions. If you have some DB enforcing unique IDs at creation time, you can manage with a lot fewer bits if you want shorter URLs or something.
Re:You Don't Need UUID by marginalia_nu on Monday September 11, 2023 @03:05PM (#37472125)
> 128 bits is an absurd amount for a unique ID within a single system. Even 48 bits is very, very large -- enough to provide a unique ID (MAC address) to every Ethernet device made for something like 100 years.

What you want is that the number of possible items to enumerate is significantly less than the square root of the cardinality of the ID range, means you can relatively safely randomly generate IDs with few collissions.