GUIDS case sensitive?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J.Marsch

    GUIDS case sensitive?

    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?


  • Mattias Sjögren

    #2
    Re: GUIDS case sensitive?

    [color=blue]
    >Is the uniqueness of a guid case-sensitive?[/color]

    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

    --
    Mattias Sjögren [MVP] mattias @ mvps.org
    http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
    Please reply only to the newsgroup.

    Comment

    • Daniel Pratt

      #3
      Re: GUIDS case sensitive?

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

      Regards,
      Dan

      "J.Marsch" <jeremy@ctcdeve loper.com> wrote in message
      news:%23BnAr12u DHA.620@TK2MSFT NGP10.phx.gbl.. .[color=blue]
      > 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?
      >
      >[/color]


      Comment

      • David Browne

        #4
        Re: GUIDS case sensitive?


        "J.Marsch" <jeremy@ctcdeve loper.com> wrote in message
        news:%23BnAr12u DHA.620@TK2MSFT NGP10.phx.gbl.. .[color=blue]
        > 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?
        >
        >[/color]

        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


        Comment

        • J.Marsch

          #5
          Re: GUIDS case sensitive? (thanks)

          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.

          "J.Marsch" <jeremy@ctcdeve loper.com> wrote in message
          news:%23BnAr12u DHA.620@TK2MSFT NGP10.phx.gbl.. .[color=blue]
          > 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?
          >
          >[/color]


          Comment

          Working...