GUID, New - How Created

G

Guest

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.
 
G

Guest

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.
 
G

Guest

Dennis,

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

Kerry Moorman
 
O

Oenone

Dennis said:
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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top