GUID, New - How Created

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

    GUID, New - How Created

    When I use GUID.NewGUID method to return a unique GUID, how is it
    constructed and can I be sure it won't be duplicated. I set a key in a
    database equal to a GUID which I create using GUID.NewGUID and don't want it
    to be duplicated. I would like to know what paramters are used by VB.Net to
    construct the new GUID, i.e., tick count, processor ID, etc.
    --
    Dennis in Houston
  • Oenone

    #2
    Re: GUID, New - How Created

    Dennis wrote:[color=blue]
    > When I use GUID.NewGUID method to return a unique GUID, how is it
    > constructed and can I be sure it won't be duplicated.[/color]

    You may find the information here useful:



    (I certainly learned something about GUIDs today :-)

    --

    (O) e n o n e


    Comment

    • Dennis

      #3
      Re: GUID, New - How Created

      Thanks. It would a appear that GUID's are in fact unique with the only way
      of getting a duplicate GUID would be for someone to reset the clock on the
      computer or use the same ethernet card on two different computers and
      generate a GUID at the same exact time.


      --
      Dennis in Houston


      "Oenone" wrote:
      [color=blue]
      > Dennis wrote:[color=green]
      > > When I use GUID.NewGUID method to return a unique GUID, how is it
      > > constructed and can I be sure it won't be duplicated.[/color]
      >
      > You may find the information here useful:
      >
      > http://kruithof.xs4all.nl/guid-uuid-make.html
      >
      > (I certainly learned something about GUIDs today :-)
      >
      > --
      >
      > (O) e n o n e
      >
      >
      >[/color]

      Comment

      • Kerry Moorman

        #4
        Re: GUID, New - How Created

        Dennis,

        I think that .Net GUIDs are generated using random numbers, not the clock or
        MAC address, etc.

        Kerry Moorman


        "Dennis" wrote:
        [color=blue]
        > Thanks. It would a appear that GUID's are in fact unique with the only way
        > of getting a duplicate GUID would be for someone to reset the clock on the
        > computer or use the same ethernet card on two different computers and
        > generate a GUID at the same exact time.
        >
        >
        > --
        > Dennis in Houston
        >
        >
        > "Oenone" wrote:
        >[color=green]
        > > Dennis wrote:[color=darkred]
        > > > When I use GUID.NewGUID method to return a unique GUID, how is it
        > > > constructed and can I be sure it won't be duplicated.[/color]
        > >
        > > You may find the information here useful:
        > >
        > > http://kruithof.xs4all.nl/guid-uuid-make.html
        > >
        > > (I certainly learned something about GUIDs today :-)
        > >
        > > --
        > >
        > > (O) e n o n e
        > >
        > >
        > >[/color][/color]

        Comment

        • Oenone

          #5
          Re: GUID, New - How Created

          Dennis wrote:[color=blue]
          > Thanks. It would a appear that GUID's are in fact unique with the
          > only way of getting a duplicate GUID would be for someone to reset
          > the clock on the computer or use the same ethernet card on two
          > different computers and generate a GUID at the same exact time.[/color]

          It depends on which type of GUID is generated.

          All the GUIDs that VS.NET generates appear to be version 4, which is
          entirely based on random numbers. This means that there is no guarantee of
          uniqueness, just a high probability.

          --

          (O)enone


          Comment

          • smith

            #6
            Re: GUID, New - How Created

            FYI:

            This talks about GUIDs for UniqueIdentifie r columns in SQLServer - what they
            are, the ups and downs of using them and how to get around the major
            performance hit of the path you seem to have chosen with your column type.

            Not hard reading, it's a classic for DB folks and I think it might help you:



            smith


            "Dennis" <Dennis@discuss ions.microsoft. com> wrote in message
            news:AB3E02FD-BFCA-43CC-B5AC-6A48D9A61313@mi crosoft.com...[color=blue]
            > When I use GUID.NewGUID method to return a unique GUID, how is it
            > constructed and can I be sure it won't be duplicated. I set a key in a
            > database equal to a GUID which I create using GUID.NewGUID and don't want
            > it
            > to be duplicated. I would like to know what paramters are used by VB.Net
            > to
            > construct the new GUID, i.e., tick count, processor ID, etc.
            > --
            > Dennis in Houston[/color]


            Comment

            Working...