Questions tagged [guid]

A GUID (Globally Unique IDentifier) is a unique reference number used as an identifier in computer software.

A GUID (Globally Unique IDentifier) is a unique reference number used as an identifier in computer software. It is Microsoft's implementation of the UUID standard.

1916 questions
4557
votes
61 answers

How to create a GUID / UUID

I'm trying to create globally-unique identifiers in JavaScript. I'm not sure what routines are available on all browsers, how "random" and seeded the built-in random number generator is, etc. The GUID / UUID should be at least 32 characters and…
Jason Cohen
  • 75,915
  • 26
  • 104
  • 111
944
votes
6 answers

Is there any difference between a GUID and a UUID?

I see these 2 acronyms thrown around, and I was wondering if there are any differences between a GUID and a UUID?
Jon Tackabury
  • 42,888
  • 45
  • 121
  • 164
815
votes
8 answers

How to create a GUID/UUID in Python

How do I create a GUID in Python that is platform independent? I hear there is a method using ActivePython on Windows but it's Windows only because it uses COM. Is there a method using plain Python?
Jonathon Watney
  • 15,080
  • 8
  • 34
  • 40
574
votes
22 answers

Is a GUID unique 100% of the time?

Is a GUID unique 100% of the time? Will it stay unique over multiple threads?
David Basarab
  • 67,994
  • 42
  • 125
  • 155
526
votes
11 answers

C# how to create a Guid value?

One field of our struct is Guid type. How to generate a valid value for it?
5YrsLaterDBA
  • 29,380
  • 38
  • 121
  • 200
522
votes
12 answers

How unique is UUID?

How safe is it to use UUID to uniquely identify something (I'm using it for files uploaded to the server)? As I understand it, it is based off random numbers. However, it seems to me that given enough time, it would eventually repeat it self, just…
Jason
  • 15,436
  • 20
  • 71
  • 112
401
votes
7 answers

What is the string length of a GUID?

I want to create a varchar column in SQL that should contain N'guid' while guid is a generated GUID by .NET (Guid.NewGuid) - class System.Guid. What is the length of the varchar I should expect from a GUID? Is it a static length? Should I use…
Shimmy Weitzhandler
  • 92,920
  • 119
  • 388
  • 596
401
votes
6 answers

Create a GUID in Java

What are some of the best ways to create a GUID in Java?
Chris Dutrow
  • 42,732
  • 59
  • 174
  • 243
372
votes
4 answers

Guid.NewGuid() vs. new Guid()

What's the difference between Guid.NewGuid() and new Guid()? Which one is preferred?
OscarRyz
  • 184,433
  • 106
  • 369
  • 548
367
votes
9 answers

What are the best practices for using a GUID as a primary key, specifically regarding performance?

I have an application that uses GUID as the Primary Key in almost all tables and I have read that there are issues about performance when using GUID as Primary Key. Honestly, I haven't seen any problem, but I'm about to start a new application and I…
VAAA
  • 12,647
  • 20
  • 110
  • 213
325
votes
12 answers

How to test valid UUID/GUID?

How to check if variable contains valid UUID/GUID identifier? I'm currently interested only in validating types 1 and 4, but it should not be a limitation to your answers.
Marek Sebera
  • 37,155
  • 34
  • 153
  • 231
323
votes
30 answers

Simple proof that GUID is not unique

I'd like to prove that a GUID is not unique in a simple test program. I expected the following code to run for hours, but it's not working. How can I make it work? BigInteger begin = new BigInteger((long)0); BigInteger end = new…
Kai
  • 5,518
  • 11
  • 40
  • 62
311
votes
6 answers

Generate a UUID on iOS from Swift

In my iOS Swift app I want to generate random UUID (GUID) strings for use as a table key, and this snippet appears to work: let uuid = CFUUIDCreateString(nil, CFUUIDCreate(nil)) Is this safe? Or is there perhaps a better (recommended) approach?
zacjordaan
  • 3,521
  • 2
  • 16
  • 16
272
votes
6 answers

Guid is all 0's (zeros)?

I'm testing out some WCF services that send objects with Guids back and forth. In my web app test code, I'm doing the following: var responseObject = proxy.CallService(new RequestObject { Data = "misc. data", Guid = new Guid() }); For some…
Didaxis
  • 7,916
  • 6
  • 45
  • 86
247
votes
9 answers

Advantages and disadvantages of GUID / UUID database keys

I've worked on a number of database systems in the past where moving entries between databases would have been made a lot easier if all the database keys had been GUID / UUID values. I've considered going down this path a few times, but there's…
Matt Sheppard
  • 111,039
  • 46
  • 105
  • 128
1
2 3
99 100