views:

702

answers:

6
+1  Q: 

What is a UUID?

Well, what is one?

+3  A: 

It's a Universally Unique Identifier

Osama ALASSIRY
A: 

See http://www.google.com/search?q=define%3A+uuid

Paul
+1  A: 

Google is your friend. There was another question about uuid yesterday.

waynecolvin
what if google finds this question? ;)
bene
+4  A: 

It's an identification number that will uniquely identify something. The idea being that that id number will be universally unique. Thus, no two things should have the same uuid. In fact, if you were to generate 10 trillion uuids, there would be something along the lines of a .00000006 chance of two uuids being the same.

Jason Baker
+3  A: 

It's a very long string of bits that is supposed to be unique now and forever, i.e. no possible clash with any other UUID produced by you or anybody else in the world .

The way it works is simply that the current timestamp, and an internet related unique property of the computer that generated it (like the IP address, which ought to be unique at the moment you're connected to internet; or the MAC address, which is more low level, a hardwired id for your network card) is part of the bitstring.

Originally every network card in the word had its own unique MAC address, but in later generations, you can change the MAC address by software, so that is not as reliable as a unique ID, any more.

bart
+6  A: 

UUIDs are defined in RFC 4122. They're Universally Unique IDentifiers, that can be generated without the use of a centralized authority. There are four major types of UUIDs which are used in slightly different scenarios. All UUIDs are 128 bits in length, but are commonly represented as 32 hexadecimal characters separated by four hyphens.

Version 1 UUIDs, the most common, combine a MAC address and a timestamp to produce sufficient uniqueness. In the event of multiple UUIDs being generated fast enough that the timestamp doesn't increment before the next generation, the timestamp is manually incremented by 1. If no MAC address is available, or if its presence would be undesirable for privacy reasons, 6 random bytes sourced from a cryptographically secure random number generator may be used for the node ID instead.

Version 3 and Version 5 UUIDs, the least common, use the MD5 and SHA1 hash functions respectively, plus a namespace, plus an already unique data value to produce a unique ID. This can be used to generate a UUID from a URL for example.

Version 4 UUIDs, are simply 128 bits of random data, with some bit-twiddling to identify the UUID version and variant.

UUID collisions are extremely unlikely to happen, especially not in a single application space.

Bob Aman