GUIDS case sensitive?

  • Thread starter Thread starter J.Marsch
  • Start date Start date
J

J.Marsch

I notice that when I generate various guids, they appear to have a mix of
upper and lowercase letters.

Is the uniqueness of a guid case-sensitive?

In other words, if I generate a guid, and then store it in a database that
is case insensitive (or if I convert the letters to upper), is it still
statistically unique?
 
Is the uniqueness of a guid case-sensitive?

No. A guid is really just 128 bits of data. The string representation
is just one way of making it a little easier to read and work with.



Mattias
 
The "letters" you refer to are actually hex digits A-F, so no, case
doesn't matter.

Regards,
Dan
 
J.Marsch said:
I notice that when I generate various guids, they appear to have a mix of
upper and lowercase letters.

Is the uniqueness of a guid case-sensitive?

In other words, if I generate a guid, and then store it in a database that
is case insensitive (or if I convert the letters to upper), is it still
statistically unique?

A GUID is a 128 bit structure. The normal string representation uses 32 hex
digits to represent the 32 nibbles in the structure, and is not
case-sensative.

EG
B864A17D-E6E6-49C0-AD41-DC7BBFCAF0D8

Other representations are concevable, eg base64, and if you have fewer than
25 characters, it MUST be case-sensative.

But you should consider storuing the GUID in a binary field in the database,
intead of a text field.

David
 
Thank you to all who replied. At one time, I had been 100% sure that the
guids were a hexadecimal representation, but then someone asked me why the
digits A-F are mixed case (VS.Net 2003 tools | generate GUID -- seems as
though it's always the 3rd segment in the string). I didn't have an answer,
so suddenly I had to question my understanding of the universe.

I'm still out to lunch on the universe thing, but at least I know that I was
right about the guids <g>

Thanks again.
 
Back
Top