<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.gamayun.site/index.php?action=history&amp;feed=atom&amp;title=The_Odds_a_UUID_Ever_Repeats</id>
	<title>The Odds a UUID Ever Repeats - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.gamayun.site/index.php?action=history&amp;feed=atom&amp;title=The_Odds_a_UUID_Ever_Repeats"/>
	<link rel="alternate" type="text/html" href="https://wiki.gamayun.site/index.php?title=The_Odds_a_UUID_Ever_Repeats&amp;action=history"/>
	<updated>2026-10-05T09:53:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.gamayun.site/index.php?title=The_Odds_a_UUID_Ever_Repeats&amp;diff=21&amp;oldid=prev</id>
		<title>GAMA: Converted from site HTML fragment to wikitext: citations, categories, cross-links</title>
		<link rel="alternate" type="text/html" href="https://wiki.gamayun.site/index.php?title=The_Odds_a_UUID_Ever_Repeats&amp;diff=21&amp;oldid=prev"/>
		<updated>2026-08-07T06:51:59Z</updated>

		<summary type="html">&lt;p&gt;Converted from site HTML fragment to wikitext: citations, categories, cross-links&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A version-4 UUID has 128 bits total, but not all of them are random: 6 are fixed by the format itself (4 bits mark it as version 4, 2 more mark the variant), leaving 122 genuinely random bits.&amp;lt;ref&amp;gt;[https://en.wikipedia.org/wiki/Universally_unique_identifier Universally unique identifier — Wikipedia]&amp;lt;/ref&amp;gt; Birthday-paradox math — the same math behind &amp;quot;how many people need to be in a room before two share a birthday&amp;quot; — says you&amp;#039;d need to generate roughly 2.71 quintillion (2.71 &amp;amp;times; 10&amp;lt;sup&amp;gt;18&amp;lt;/sup&amp;gt;) version-4 UUIDs before the odds of any two colliding crossed 50%. Every UUID this site has ever generated, and every one it ever will, is functionally guaranteed unique — not because the math forbids a collision, but because the number of UUIDs that would need to exist for one is bigger than most estimates of the total data ever stored by humanity.&lt;br /&gt;
&lt;br /&gt;
== Not all UUIDs are random ==&lt;br /&gt;
&amp;quot;UUID&amp;quot; names a format (128 bits, that familiar &amp;lt;code&amp;gt;8-4-4-4-12&amp;lt;/code&amp;gt; hyphenated hex layout), not a single method for filling it. The version number — a single hex digit baked into the string itself — says how it was actually generated, and the versions in real use trade off very differently:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;v1 (timestamp + MAC address).&amp;#039;&amp;#039;&amp;#039; Encodes the generating machine&amp;#039;s network MAC address and a high-precision timestamp directly into the UUID. Guaranteed unique per machine as long as its clock doesn&amp;#039;t move backward, but it leaks two things a random UUID doesn&amp;#039;t: roughly when the record was created, and a hardware identifier for the machine that created it.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;v4 (random).&amp;#039;&amp;#039;&amp;#039; What most tools generate by default today. No embedded information beyond &amp;quot;this was made to be a UUID.&amp;quot;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;v5 (name-based, SHA-1).&amp;#039;&amp;#039;&amp;#039; Deterministic: the same input name plus the same namespace always produces the same UUID. v3 is the same idea with the older, weaker MD5 instead of SHA-1, kept mainly for backward compatibility.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;v7 (Unix-timestamp-prefixed, random tail).&amp;#039;&amp;#039;&amp;#039; A newer addition to the standard, formalized in RFC 9562 (2024), built specifically to fix a real operational problem with v4: database indexes built on a v4 primary key fragment badly over time because insert order has nothing to do with sort order, whereas a v7 UUID sorts roughly chronologically by creation time the way an auto-incrementing integer does.&amp;lt;ref&amp;gt;[https://datatracker.ietf.org/doc/html/rfc9562 RFC 9562: Universally Unique IDentifiers (UUIDs) — IETF, 2024]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The alternative that isn&amp;#039;t a UUID at all ==&lt;br /&gt;
Before v7 existed, teams that wanted both &amp;quot;sortable like a timestamp&amp;quot; and &amp;quot;collision-resistant like a UUID&amp;quot; often reached for a non-standard format instead — ULID (Universally Unique Lexicographically sortable ID) and Twitter&amp;#039;s Snowflake ID are the two most common. Both encode a timestamp plus randomness or a machine/sequence counter into a fixed-width identifier, sort naturally, and predate v7&amp;#039;s standardization.&lt;br /&gt;
&lt;br /&gt;
== What actually goes wrong in practice ==&lt;br /&gt;
Real UUID collisions in production systems are, unsurprisingly, essentially never caused by the random-number math failing — they&amp;#039;re caused by something upstream of the math: a bad or predictable random number generator, a v1 UUID generated on a virtual machine that cloned its MAC address, or — far more common than either — a caching or retry bug that generates the same UUID twice by accident rather than the generator itself repeating. If two UUIDs in a real system ever collide, the math above is not where to start debugging.&lt;br /&gt;
&lt;br /&gt;
The underlying idea — that a few dozen bits of real entropy is enough to make a collision practically impossible — is the same math [[Browser Fingerprinting]] runs in reverse: there, a much smaller entropy budget (tens of bits, not 122) is enough to make a browser practically identifiable instead.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Browser Fingerprinting]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Mathematics, Probability, &amp;amp; Game Theory]]&lt;/div&gt;</summary>
		<author><name>GAMA</name></author>
	</entry>
</feed>