3

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?

Welbog
  • 59,154
  • 9
  • 110
  • 123
mainstringargs
  • 13,563
  • 35
  • 109
  • 174
  • 1
    If this is a question for a specific case, then: are you sure you need the Universal uniqueness? – Arjan Apr 21 '09 at 12:34

4 Answers4

6

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

Lucero
  • 59,176
  • 9
  • 122
  • 152
4

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

erickson
  • 265,237
  • 58
  • 395
  • 493
1

You might find the latest podcast relevant:

http://itc.conversationsnetwork.org/shows/detail4087.html

Database-wide unique-yet-simple identifiers in SQL Server

Community
  • 1
  • 1
Brian
  • 117,631
  • 17
  • 236
  • 300
0

You want Base64 if it is going to be in any kind of computer representation. Base85 if you can figure out a way around putting it in a URL. See: http://en.wikipedia.org/wiki/Base64 and http://en.wikipedia.org/wiki/Ascii85

Dennis
  • 747
  • 7
  • 15