473,809 Members | 2,809 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3467
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.goo glegroups.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.00 0.000.000.000.0 00.000.
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.goo glegroups.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.goo glegroups.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******** *************@o 13g2000cwo.goog legroups.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**********@s kyscan.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

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

Similar topics

4
15657
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 not be used. However, every article strongly implies, if it does not state it outright, that GUID's are always unique. My question is this, what happens if you have a database that uses GUID's and the NIC is changed out on the box? From what I...
6
3686
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
34850
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 "Guid.NewGuid()"would generate a Guid.Empty value could this be possible or is the "00000000-0000-0000-0000-000000000000" Guid reserved or something like that? Thank you.
14
14280
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. -- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Slow internet connection?
5
6346
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 uniqueidentifier, originally taken from objectGUID from active directory domain)
5
13717
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 of machines involved (1 to dozens) and an indeterminate number of objects (many to very many on each machine). My best guess for a solution would be to use a GUID (all the machines have an ethernet connection so a GUID generated on any of them...
1
4128
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 dashes. client.PartyHomeAddressID = new Guid(contact.Substring(1542, 36).Trim());
5
6504
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 following error: System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Web.Services.Protocols.HttpServerType..ctor(Type type) at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
2
16239
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 element for each item node in my feed. Some items do not have the "link" node because the description element is the content. So using the "link" as the guid will not work in my case, as some sites suggest and as feedvalidator.org complains when I do not...
4
5525
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 work. void gv_RowCommand(Object sender, GridViewCommandEventArgs e) { ClientScript.RegisterStartupScript(GetType(), "MyAlert2", "alert('Command=" + e.CommandName + "');", true); if (e.CommandName == "New")
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10639
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10383
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.