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

Home Posts Topics Members FAQ

How Unique is a GUID

Hi,

I'm trying to find out how unique a GUID is?

Basically I have two web applications and I need to pass a couple of
session variables between them using a table in a database. I have set
this up and used a GUID as a key for the table and it all seems to
work fine but I'm a little concerned about the uniqueness of the GUID.

Does anyone know how the GUID is created?
or if it is unique across all applications on a webserver?
Thanks
Davinder

Apr 20 '07 #1
5 9718
Hello Davinder,

http://en.wikipedia.org/wiki/GUID
http://en.wikipedia.org/wiki/Univers...que_Identifier

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

DBasically I have two web applications and I need to pass a couple of
Dsession variables between them using a table in a database. I have
Dset this up and used a GUID as a key for the table and it all seems
Dto work fine but I'm a little concerned about the uniqueness of the
DGUID.
D>
Apr 20 '07 #2
avh

"Davinder" <da*************@gmail.comschreef in bericht
news:11**********************@y5g2000hsa.googlegro ups.com...
Hi,

I'm trying to find out how unique a GUID is?

Basically I have two web applications and I need to pass a couple of
session variables between them using a table in a database. I have set
this up and used a GUID as a key for the table and it all seems to
work fine but I'm a little concerned about the uniqueness of the GUID.

Does anyone know how the GUID is created?
or if it is unique across all applications on a webserver?
Thanks
Davinder


Hi Davinder,

A GUID is GLOBALLY unique.
Trust me: from the moment on this wouldn't be the case anymore, a lot of
applications will get into trouble.
It contains reference to the unique MAC address of the network adapter +
random bytes + date/time etc ...

On Windows NT servers in the past GUIDs produced consecutively GUIDS (unique
still though), but this has changed in future versions of Windows.

Wim
Apr 20 '07 #3
avh
"Davinder" <da*************@gmail.comschreef in bericht
news:11**********************@y5g2000hsa.googlegro ups.com...
Hi,

I'm trying to find out how unique a GUID is?

Basically I have two web applications and I need to pass a couple of
session variables between them using a table in a database. I have set
this up and used a GUID as a key for the table and it all seems to
work fine but I'm a little concerned about the uniqueness of the GUID.

Does anyone know how the GUID is created?
or if it is unique across all applications on a webserver?
Thanks
Davinder

Since it is GLOBALLY unique, you can't be sure that this GUID will not be
re-used on Mars !,
so you might get into trouble if you are planning to use this for message
exchange with aliens ! :-)
Apr 20 '07 #4

Michael, Wim thanks for your replys, the info is very helpful.

after I had written the message I actually did a quick test and
produced 100,000 GUIDs from my web apps and there were no clashes, so
I guess it should all run without any problems.

Since it is GLOBALLY unique, you can't be sure that this GUID will not be
re-used on Mars !,
so you might get into trouble if you are planning to use this for message
exchange with aliens ! :-)
ahh this may cause a problem in the future then! I was planning on
hosting one of the web apps on mars so aliens could use it, guess I'll
have to come up woth a workaround, oh well :o)

Davinder

Apr 20 '07 #5
You should have read the Wikipedia article. You would have saved yourself
some trouble. The probability of 2 GUIDs being the same is about 1 in a
quintillion.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Davinder" <da*************@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
>
Michael, Wim thanks for your replys, the info is very helpful.

after I had written the message I actually did a quick test and
produced 100,000 GUIDs from my web apps and there were no clashes, so
I guess it should all run without any problems.

>Since it is GLOBALLY unique, you can't be sure that this GUID will not be
re-used on Mars !,
so you might get into trouble if you are planning to use this for message
exchange with aliens ! :-)

ahh this may cause a problem in the future then! I was planning on
hosting one of the web apps on mars so aliens could use it, guess I'll
have to come up woth a workaround, oh well :o)

Davinder

Apr 20 '07 #6

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

Similar topics

8
4468
by: Joe Wong | last post by:
Hi, I need to implement a unique number generator that 1 or more processes on same or different machines will make use of it. Is there any library / project available already for this? Thanks...
4
15616
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
3051
by: Mullin Yu | last post by:
hi, i have a web service that has file operations on Windows OS, and there may be a file concurrency issue if only one working directory e.g. c:\working therefore, i want to have a unique sub...
4
1652
by: Brett | last post by:
The following is called each time an event is triggered. The generated GUID is the same for 3 of 4 calls. Is there a way to ensure it is different for each call? ...
2
4512
by: Chris Dunaway | last post by:
I have a web service which is accessed by a windows forms application. When the application submits a unit of work (a "job"), I want to return a job receipt or tracking number back to the...
14
2693
by: Chris Dunaway | last post by:
I have used Guid's as a unique identifier in data applications. But in a recent project, the length of the Guid's string is proving to be too long. Is there a method for generating a unique...
7
2771
by: cj | last post by:
I need to choose a 20 char unique id for transactions handled by my multithreaded program. I can't decide if to use Dim uid As String = Guid.NewGuid.ToString uid = uid.Replace("-", "") uid =...
16
6896
by: Mark S. | last post by:
I'm a fan of the GUID, but the current project is looking to use a genuinely unique integer. Does the following do that? Math.Abs(System.Guid.NewGuid().GetHashCode()) TIA
6
4339
by: =?Utf-8?B?QWxwaGFwYWdl?= | last post by:
Hello, I want to generate a unique ID for each page of my Asp.Net application. My first step is to generate a new Guid when the page is loaded for the first time and registers, stores this new...
0
7224
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,...
1
7038
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...
0
7493
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...
0
5625
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,...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
415
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...

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.