views:

432

answers:

4

What is the smallest way to store a UUID that is human readable and widely database compatible?

I am thinking a char array of some sort using hex values?

+4  A: 

As common approach, i think that encoding the binary data (16 bytes) as Base64 could be what you want.

Lucero
+2  A: 

A UUID is defined as a 128-bit number. It doesn't get smaller or bigger than that. You can, of course, inflate your storage requirements by storing the number as something other than a number, but that is up to you and your requirements.

Ed Guiness
I guess binary data does not really qualify as "human readable and widely database compatible"...
Lucero
Who mentioned binary data? A 128-bit number is both human readable and widely database compatible. Besides that the OP asked specifically for UUID, which has an actual definition you see...
Ed Guiness
+1  A: 

Use Base-85 encoding to store the UUID as 20 US-ASCII characters.

erickson