Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. The Proof that a GUID is not unique

The Proof that a GUID is not unique

Scheduled Pinned Locked Moved The Lounge
questioncomalgorithmsperformance
43 Posts 30 Posters 79 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P patbob

    Systems without network cards can generate GUIDs. What do they use for their MAC address? Yup.. zeros. A GUID also includes clock ticks of some sort or another that (they hope) tick faster than the system can request GUIDs. I seem to recall there's some bits in there for sequence number within a clock tick, or maybe systems just keep track of the last one issued and ensure they don't generate duplicates. I think there might be some other sources of mostly unique bits thrown in, like CPU serial numbers or something. The idea being that within a given uptime, of a given OS load, on a given system, they are guaranteed to be unique, and between systems, they are as unique as reasonably possible. How are these bits packed into the GUID? It doesn't matter, no amount of deterministically massaging the bits will give you anything more unique. Massaging the source bits could obscure them and make backtracking to the original values for nefarious purposes more difficult, and I suspect its done. Using the source bits as seed for a pseudorandom number generator won't add uniqueness, but it is probably a pretty good, and inexpensive, way to deterministically massage the bits to obscure them. GUIDs were never absolutely guaranteed to be unique, and I'd be willing to bet most of those sources of unique bits are no longer unique once one starts running GUID generation code in virtual machines.

    We can program with only 1's, but if all you've got are zeros, you've got nothing.

    D Offline
    D Offline
    dpminusa
    wrote on last edited by
    #41

    This has always interested me. I guess I should try to research it better sometime. Thanks for the great insights.

    "Courtesy is the product of a mature, disciplined mind ... ridicule is lack of the same - DPM"

    1 Reply Last reply
    0
    • M Marco Bertschi

      Searching for the number of possible GUIDs (answering questions in the forum section) I struggled over this amusing SO Thread where they are seriously discussing how the non-unique nature of a GUID can be proofed. Enjoy[^] Edit -> Here is my answer to the said question (can you think of a creative one yourself?):

      Quote:

      A Guid is 128 bit. Therefore you would have to generate 2^128 + 1 GUIDs to encounter a single GUID twice. A thread on StackOverflow.com[^] says that you would need about 10790283070806014188970 years to encounter a single GUID twice, assuming your program does nothing else than creating GUIDs and runs at a processor speed of 1 GhZ, without any interruption by CPU power eaten by other programs or the operating system itself. As you probably can think now, encountering the same GUID twice would be very bad luck and can safely considered as being unrealistic.

      People becoming wiser in order to notice the stupid things they did back in the young days. This doesn't mean that they really stop doing those things. Wise people still do stupid things, only on purpose.

      M Offline
      M Offline
      Member 4608898
      wrote on last edited by
      #42

      MS generates two types of GUID: one that is MAC address based and one that is time based. If you generate them sequentially, it will tke you some time to get a duplicate but if you generate them at random, it is a lot easier to get a duplicate. I have had duplicates several times.

      1 Reply Last reply
      0
      • M Mark_Wallace

        Did it include the characters S, S, N, N, L, L, L, I, I, E, E, E, and E?

        I wanna be a eunuchs developer! Pass me a bread knife!

        S Offline
        S Offline
        Septimus Hedgehog
        wrote on last edited by
        #43

        I'm sure our dearly departed forum friend Leslie would confirm that. :laugh:

        If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups