Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes, you can. Since GUIDs are 128 bits long, there is admittedly a minute possibility of a clash—but the word "minute" is nowhere near strong enough. There are <em>so many GUIDs</em> that if you generate <em>several trillion</em> of them randomly, you're still more likely to get hit by a meteorite than to have even one collision (from <a href="http://en.wikipedia.org/wiki/UUID" rel="noreferrer">Wikipedia</a>). And if you aren't generating them randomly, but are <em>e.g.</em> using the MAC-address-and-time-stamp algorithm, then they're also going to be unique, as MAC addresses are unique among computers and time stamps are unique on <em>your</em> computer.</p> <p><strong>Edit 1:</strong> To answer your bonus question, the optimal way to test a set of GUIDs for uniqueness is to just assume that they are all are unique. Why? Because, given the number of GUIDs you're generating, the odds of a GUID collision are smaller than the odds of a cosmic ray flipping a bit in your computer's memory and screwing up the answer given by any "accurate" algorithm you'd care to run. (See <a href="https://stackoverflow.com/questions/2580933/cosmic-rays-what-is-the-probability-they-will-affect-a-program/2580963#2580963">this StackOverflow answer</a> for the math.)</p> <p>There are an <em>enormous</em> number of GUIDs out there. To quote Douglas Adams's <em>Hitchhiker's Guide to the Galaxy</em>:</p> <blockquote> <p>"Space," it says, "is big. Really big. You just won't believe how vastly hugely mindbogglingly big it is. I mean you may think it's a long way down the road to the chemist, but that's just peanuts to space, listen…"</p> </blockquote> <p>And since there are <a href="http://en.wikipedia.org/wiki/Observable_universe#Matter_content" rel="noreferrer">about 7×10<sup>22</sup> stars in the universe</a>, and just under 2<sup>128</sup> GUIDs, then there are approximately 4.86×10<sup>15</sup>—almost <em>five quadrillion</em>—GUIDs for every single star. If every one of those stars had a world with a thriving population like ours, then around each and every star, <em><a href="http://www.wolframalpha.com/input/?i=people+who+have+ever+lived" rel="noreferrer">every human or alien who had ever lived</a></em> would be entitled to over forty-five thousand GUIDs. For every person in history at every star in the universe. The GUID space is at the same level of hugeness as the size of the entire universe. You do <em>not</em> need to worry.</p> <p>(<strong>Edit 2:</strong> Reflecting on this: wow. I hadn't realized <em>myself</em> what this meant. The GUID space is incomprehensibly massive. I'm sort of in awe of it.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload