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.

2008 questions
5272
votes
73 answers

How do I create a GUID / UUID?

How do I create GUIDs (globally-unique identifiers) in JavaScript? The GUID / UUID should be at least 32 characters and should stay in the ASCII range to avoid trouble when passing them around. I'm not sure what routines are available on all…
Jason Cohen
  • 81,399
  • 26
  • 107
  • 114
1185
votes
8 answers

How to create a GUID/UUID in Python

How do I create a GUID/UUID 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
  • 20,248
  • 9
  • 38
  • 40
1133
votes
5 answers

Is there any difference between a GUID and a UUID?

I see these two acronyms being thrown around and I was wondering if there are any differences between a GUID and a UUID?
Jon Tackabury
  • 47,710
  • 52
  • 130
  • 168
682
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
  • 17,276
  • 23
  • 73
  • 114
657
votes
24 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
  • 72,212
  • 42
  • 129
  • 156
613
votes
12 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
  • 33,370
  • 43
  • 136
  • 210
462
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
  • 101,809
  • 122
  • 424
  • 632
442
votes
7 answers

Create a GUID / UUID in Java

What are some of the best ways to create a GUID / UUID in Java?
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258
426
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
  • 14,531
  • 28
  • 130
  • 253
405
votes
5 answers

Guid.NewGuid() vs. new Guid()

What's the difference between Guid.NewGuid() and new Guid()? Which one is preferred?
OscarRyz
  • 196,001
  • 113
  • 385
  • 569
397
votes
18 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
  • 39,650
  • 37
  • 158
  • 244
331
votes
8 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,731
  • 2
  • 18
  • 16
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,850
  • 13
  • 43
  • 63
307
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
  • 8,486
  • 7
  • 52
  • 89
273
votes
10 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
  • 116,545
  • 46
  • 111
  • 131
1
2 3
99 100