tags:

views:

50

answers:

2

How can applications ensure it's unique?

+1  A: 

Wikipedia is your friend:

http://en.wikipedia.org/wiki/Globally_unique_identifier

Mike Caron
Well, they're not unique, only very likely to not collide :)
Yann Ramin
-1 - You should read the article you're referring to.
Kyle Rozendo
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
@Kyle: I did. What's the problem?
Mike Caron
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
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
+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