How can applications ensure it's unique?
Well, they're not unique, only very likely to not collide :)
Yann Ramin
2010-08-17 05:14:13
-1 - You should read the article you're referring to.
Kyle Rozendo
2010-08-17 05:15:45
Actually, I don't think they can collide, on the same machine, unless you somehow freeze the clock and generate GUIDs looking for a collision.
Mike Caron
2010-08-17 05:15:59
@Kyle: I did. What's the problem?
Mike Caron
2010-08-17 05:16:14
1. They're not unique, just highly unlikely to be regenerated. 2. They do not use machine specific data with the current time anymore, they use PRNGs. The only thing right in your answer, is the link.
Kyle Rozendo
2010-08-17 05:17:55
Hmm, you are correct (although, only according to the UUID page, as posted by Carl). I've amended my answer to just include the link, then.
Mike Caron
2010-08-17 05:22:37
+1
A:
Well, it's a 128-bit number - collisions are pretty unlikely. Even if it were completely random, you'd be unlikely to get a duplicate even in the history of the universe. There are some modifications to pure randomness to help even those collisions from occuring in practice - you can read several of them on wikipedia.
Carl Norum
2010-08-17 05:14:00