473,387 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

GUID

Hi,

The following is from MSDN.

"A GUID is a 128-bit integer (16 bytes) that can be used across all
computers and networks wherever a unique identifier is required. Such
an identifier has a very low probability of being duplicated."

My application will crush if I have two or more number that are
identical, so I need to know do I need to worry about this"
very low probability " of having two identical numbers generated from
Guid structure.

Thanks.

Nov 17 '05 #1
10 3415
I don't think you will have an issue with using a GUID.

Are you using this in a database table as the primary key?
<ww*****@gmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Hi,

The following is from MSDN.

"A GUID is a 128-bit integer (16 bytes) that can be used across all
computers and networks wherever a unique identifier is required. Such
an identifier has a very low probability of being duplicated."

My application will crush if I have two or more number that are
identical, so I need to know do I need to worry about this"
very low probability " of having two identical numbers generated from
Guid structure.

Thanks.

Nov 17 '05 #2
> "A GUID is a 128-bit integer (16 bytes) that can be used across all
computers and networks wherever a unique identifier is required. Such
an identifier has a very low probability of being duplicated."

My application will crush if I have two or more number that are
identical, so I need to know do I need to worry about this"
very low probability " of having two identical numbers generated from
Guid structure.

It is based on a nework card MAC, and these should be unique on all network
cards.
Also take into account the date and time and some random generator and the
chance that you get a duplicate is almost none existing. It happens maybe
once if a milennium? ;-)
Nov 17 '05 #3
Well, you know.

a 128 number is a 128 bit number. Chances are much higher to win a 6 in a
lottery than you having two double GUIDs.

Risk the crash. I do the same for about 5 years, and never ever got a
double. Not once.

Just translate 2^128 to decmial to see what you talk about.

This translates to 340.200.000.000.000.000.000.000.000.000.000.000.00 0.
Roughly.

--
Regards

Thomas Tomiczek
THONA Software & Consulting Ltd.
(Microsoft MVP C#/.NET)
(CTO PowerNodes Ltd.)
---

Still waiting for ObjectSpaces? Try the EntityBroker today - more versatile,
more powerfull.
And something in use NOW. for the projects you have to deliver - NOW.
<ww*****@gmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Hi,

The following is from MSDN.

"A GUID is a 128-bit integer (16 bytes) that can be used across all
computers and networks wherever a unique identifier is required. Such
an identifier has a very low probability of being duplicated."

My application will crush if I have two or more number that are
identical, so I need to know do I need to worry about this"
very low probability " of having two identical numbers generated from
Guid structure.

Thanks.

Nov 17 '05 #4

<ww*****@gmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Hi,

The following is from MSDN.

"A GUID is a 128-bit integer (16 bytes) that can be used across all
computers and networks wherever a unique identifier is required. Such
an identifier has a very low probability of being duplicated."

My application will crush if I have two or more number that are
identical, so I need to know do I need to worry about this"
very low probability " of having two identical numbers generated from
Guid structure.

Thanks.


Again, if you don't have a network card, the GUID will be semi-unique.
With a network card your GUID will be guranteed to be unique for many
millenia to come.

So you should not worry.

Happy Coding
- Michael S
- Michael S
Nov 17 '05 #5
Actually it is not longer using the Mac address.
But if it was using it would be disaster, becouse every 16 years old
teenager who has a computer in his father garage is can changing the
Mac address of his computer. Now it is really comon becouse some
Internet Providers are identifing the computer by their Mac address and
people do cange their Mac address to steal someone else Internet. So if
I was depending on the Mac address and I can crush my application.

In someones blog I was reading that GUID is no longer using the Mac
address.
But any way my question is - could I really depend on GUID.
And If I am writing something that I do not want to take any chances.

Do you find it reasonable to check every time whether I have
duplicates.

Thanks

Nov 17 '05 #6
Yes. You can depend on GUID's. We have several applications that use a GUID
as a primary key and have not had any issues of duplicates.

If you are that uncomfortable with using GUID's in fear of duplicates, then
do what you suggested and check to see if the GUID exists before using it.

Good luck!

Yosh

<ww*****@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Actually it is not longer using the Mac address.
But if it was using it would be disaster, becouse every 16 years old
teenager who has a computer in his father garage is can changing the
Mac address of his computer. Now it is really comon becouse some
Internet Providers are identifing the computer by their Mac address and
people do cange their Mac address to steal someone else Internet. So if
I was depending on the Mac address and I can crush my application.

In someones blog I was reading that GUID is no longer using the Mac
address.
But any way my question is - could I really depend on GUID.
And If I am writing something that I do not want to take any chances.

Do you find it reasonable to check every time whether I have
duplicates.

Thanks

Nov 17 '05 #7
> Actually it is not longer using the Mac address.
But if it was using it would be disaster, becouse every 16 years old
teenager who has a computer in his father garage is can changing the
Mac address of his computer. Now it is really comon becouse some
Internet Providers are identifing the computer by their Mac address and
people do cange their Mac address to steal someone else Internet. So if
I was depending on the Mac address and I can crush my application.

I doubt that very much that the MAC address is not used anymore.
But it is not only the Mac address, but also the processor ID, harddisk
ID,... anything that has a unique ID in it is beeing used as far as I heard.
So even if the MAC address is beeing duplicated, the GUID will still be
unique.
Nov 17 '05 #8

"Olaf Baeyens" <ol**********@skyscan.be> wrote in message
news:42**********************@news.skynet.be...
Actually it is not longer using the Mac address.
But if it was using it would be disaster, becouse every 16 years old
teenager who has a computer in his father garage is can changing the
Mac address of his computer. Now it is really comon becouse some
Internet Providers are identifing the computer by their Mac address and
people do cange their Mac address to steal someone else Internet. So if
I was depending on the Mac address and I can crush my application.

I doubt that very much that the MAC address is not used anymore.
But it is not only the Mac address, but also the processor ID, harddisk
ID,... anything that has a unique ID in it is beeing used as far as I
heard.
So even if the MAC address is beeing duplicated, the GUID will still be
unique.


The MAC address might still be used on downlevel windows W95 and 98 when
generating UUID's (DCE algorithm), but the UUID generation algorithm has
been changed to a random number on NT based systems years ago.
Other stuff like CPU Id and HW disk numbers have never been part of the
UUID.
Just run uuidgen a couple of times from the commandline and watch the
result, if anything like MAC address would be part of it you would notice
it, right?

Willy.

Nov 17 '05 #9
> The MAC address might still be used on downlevel windows W95 and 98 when
generating UUID's (DCE algorithm), but the UUID generation algorithm has
been changed to a random number on NT based systems years ago.
Other stuff like CPU Id and HW disk numbers have never been part of the
UUID.
Just run uuidgen a couple of times from the commandline and watch the
result, if anything like MAC address would be part of it you would notice
it, right?

This strikes me very odd, since you had a almost guaranteed unique systesm
because the MAC address and CPU ID were completely unique. And this in
combination with a time could generate a really unique GUID. Ok CPU ID can
be deactivated, and the MAC addres could be duplicated, but still most users
would probably have a unique MAC address, so in my opinion this could
improve the uniqueness of the GUID even more.

I always thought that generating perfect random numbers were alsmost
impossible in software. You could come close to it (hence the seed) but it
was not really random. So by not using the MAC address you have an increased
risk that a random number happen to occur 2 times.

So I am wondering why they did this?

Anyway, unique GUID or not, anyone relying on unique numbers should at least
built a protection in his software in case a duplicate GUID is used. Not
because GUID is bad, but because people might generate a fixed GUID on
purpose to crash that software in order to some bad things with it. Hackers
are very good in this.
Nov 17 '05 #10

"Olaf Baeyens" <ol**********@skyscan.be> wrote in message
news:42**********************@news.skynet.be...
The MAC address might still be used on downlevel windows W95 and 98 when
generating UUID's (DCE algorithm), but the UUID generation algorithm has
been changed to a random number on NT based systems years ago.
Other stuff like CPU Id and HW disk numbers have never been part of the
UUID.
Just run uuidgen a couple of times from the commandline and watch the
result, if anything like MAC address would be part of it you would notice
it, right?

This strikes me very odd, since you had a almost guaranteed unique systesm
because the MAC address and CPU ID were completely unique. And this in
combination with a time could generate a really unique GUID. Ok CPU ID can
be deactivated, and the MAC addres could be duplicated, but still most
users
would probably have a unique MAC address, so in my opinion this could
improve the uniqueness of the GUID even more.

I always thought that generating perfect random numbers were alsmost
impossible in software. You could come close to it (hence the seed) but it
was not really random. So by not using the MAC address you have an
increased
risk that a random number happen to occur 2 times.

So I am wondering why they did this?

Anyway, unique GUID or not, anyone relying on unique numbers should at
least
built a protection in his software in case a duplicate GUID is used. Not
because GUID is bad, but because people might generate a fixed GUID on
purpose to crash that software in order to some bad things with it.
Hackers
are very good in this.


Guid.NewGuid() winds up in calling Win32's CryptGenRandom on W2K and higher
boxes.
Chances that you get two 16 byte sequences that are equal from this random
number generator is 1/(2^128).
Note that unlike rand(), CryptGenRandom isn't a repeatable random number
generator, so you can give it the same seed twice in a row, you'll get
totaly different numbers back.

Why the change?
1. Privacy and security concerns, people didn't like to give away their MAC
address.
2. Setting the clock back is obviously the weak point of the OSF DCE
algorithm.

Willy.

Nov 17 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Louis Frolio | last post by:
Greetings All, I have read many upon many articles here regarding GUID data types and uniqueness. There have been many opinions regarding the effectiveness of GUID's and when they should/should...
6
by: Jim Heavey | last post by:
When I use the new(Guid), the GUID which is generated is all zeros. Is there a technique for the system to assign a real Guid? Do I have to manually calculate a GUID?
9
by: Rene | last post by:
I am using the Guid.Empty value ("00000000-0000-0000-0000-000000000000") to represent a special meaning. The problem is that I don't know if there is a chance that a command like...
14
by: Nak | last post by:
Hi there, Does anyone know how I would get the value of the assembly GUID in code from within the same application? Thanks in advance. Nick. --...
5
by: rcolby | last post by:
Evening, Wondering if someone can point me in the right direction, on how I would compare a system.guid with a system.byte. system.guid (pulled from sql server table with a data type of...
5
by: George | last post by:
I want to create a unique id for each of a set of objects. These ids may be generated on multiple machines simultaneously and must all be different to each other. There are an undefined number...
1
by: Wolf | last post by:
Hi I am trying to set a property(PartyHomeAddressID) = to a guid in a ini file. But everytime when the ini file has an empty guid it breaks with an error tellin me a guid is 32 char long with 4...
5
by: Michael Primeaux | last post by:
I have a simple .NET 2.0 web service created with VS.NET 2005 with a single web method with the following signature: void HelloWorld(Guid parameter1); When calling this method I receive the...
2
by: Troll | last post by:
Windows XP Pro VS 2005 & C# (I'm fairly new to C# but have doing VB.Net going on 2yrs and VB6 for 5yrs.) I'm using C# to build a custom RSS generator. I'm having trouble building the guid...
4
by: Marc | last post by:
Hi, I don't get it I cannot get this to work, can somebody give me a hint Table1 contains a field Id which is a GUID as primary key and DATA a string, I want to insert a new row but it does not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.