Questions tagged [guid]
A GUID (Globally Unique IDentifier) is a unique reference number used as an identifier in computer software.
guid
2,017
questions
5374
votes
75
answers
3.1m
views
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 ...
1237
votes
8
answers
1.2m
views
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 ...
1161
votes
5
answers
348k
views
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?
709
votes
12
answers
363k
views
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 ...
675
votes
25
answers
270k
views
Is a GUID unique 100% of the time?
Is a GUID unique 100% of the time?
Will it stay unique over multiple threads?
624
votes
13
answers
577k
views
C# how to create a Guid value?
One field of our struct is Guid type. How to generate a valid value for it?
472
votes
7
answers
471k
views
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 ...
453
votes
7
answers
466k
views
Create a GUID / UUID in Java
What are some of the best ways to create a GUID / UUID in Java?
431
votes
9
answers
226k
views
What are the best practices for using a GUID as a primary key, specifically regarding performance? [closed]
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 ...
424
votes
19
answers
359k
views
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.
406
votes
5
answers
237k
views
Guid.NewGuid() vs. new Guid()
What's the difference between Guid.NewGuid() and new Guid()?
Which one is preferred?
336
votes
8
answers
191k
views
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 ...
323
votes
30
answers
273k
views
Simple proof that GUID is not unique [closed]
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((...
317
votes
6
answers
150k
views
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 = "...
277
votes
10
answers
113k
views
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 ...
213
votes
8
answers
123k
views
How to create a GUID/UUID using iOS
I want to be able to create a GUID/UUID on the iPhone and iPad.
The intention is to be able to create keys for distributed data that are all unique. Is there a way to do this with the iOS SDK?
210
votes
4
answers
409k
views
SQL Server: converting UniqueIdentifier to string in a case statement
We have a log table that has a message column that sometimes has an exception stack trace. I have some criteria that determines if the message has this. We do not want to show these messages to the ...
189
votes
19
answers
82k
views
Test if string is a guid without throwing exceptions?
I want to try to convert a string to a Guid, but I don't want to rely on catching exceptions (
for performance reasons - exceptions are expensive
for usability reasons - the debugger pops up
for ...
176
votes
10
answers
250k
views
How to validate GUID is a GUID
How to determine if a string contains a GUID vs just a string of numbers.
will a GUID always contain at least 1 alpha character?
172
votes
5
answers
201k
views
What is the default value for Guid?
The default value for int is 0 , for string is "" and for boolean it is false. Could someone please clarify what the default value for guid is?
167
votes
10
answers
186k
views
How should I store GUID in MySQL tables?
Do I use varchar(36) or are there any better ways to do it?
165
votes
12
answers
135k
views
Best way to create unique token in Rails?
Here's what I'm using. The token doesn't necessarily have to be heard to guess, it's more like a short url identifier than anything else, and I want to keep it short. I've followed some examples I've ...
165
votes
11
answers
109k
views
Generating GUIDs in Ruby
I have a problem that is really easily solved with GUIDs.
In particular, for a password reset workflow, I would like to send a GUID token to a user's email and have them reset their password using the ...
158
votes
20
answers
102k
views
Are GUID collisions possible?
I'm working on a database in SQL Server 2000 that uses a GUID for each user that uses the app it's tied to. Somehow, two users ended up with the same GUID. I know that microsoft uses an algorithm to ...
137
votes
7
answers
57k
views
Is it safe to assume a GUID will always be unique?
I know there is a minute possibility of a clash but if I generated a batch of 1000 GUIDs (for example), would it be safe to assume they're all unique to save testing each one?
Bonus question
An ...
137
votes
12
answers
269k
views
Generate GUID in MySQL for existing Data?
I've just imported a bunch of data to a MySQL table and I have a column "GUID" that I want to basically fill down all existing rows with new and unique random GUID's.
How do I do this in MySQL ?
I ...
125
votes
7
answers
58k
views
How to Create Deterministic Guids
In our application we are creating Xml files with an attribute that has a Guid value. This value needed to be consistent between file upgrades. So even if everything else in the file changes, the guid ...
115
votes
10
answers
216k
views
How to generate a GUID in Oracle?
Is it possible to auto-generate a GUID into an Insert statement?
Also, what type of field should I use to store this GUID?
114
votes
4
answers
93k
views
I need to generate uuid for my rails application. What are the options(gems) I have? [duplicate]
I use
Rails 3.0.20 and
ruby 1.8.7 (2011-06-30 patchlevel 352)
Please suggest me the best plugin to generate guid.
114
votes
13
answers
120k
views
How to generate short uid like "aX4j9Z" (in JS)
For my web application (in JavaScript) I want to generate short guids (for different objects - that are actually different types - strings and arrays of strings)
I want something like "aX4j9Z" for my ...
108
votes
3
answers
62k
views
UUID format: 8-4-4-4-12 - Why?
Why are UUID's presented in the format "8-4-4-4-12" (digits)? I've had a look around for the reason but can't find the decision that calls for it.
Example of UUID formatted as hex string:
58D5E212-...
105
votes
5
answers
67k
views
SCOPE_IDENTITY() for GUIDs?
Can anyone tell me if there is an equivalent of SCOPE_IDENTITY() when using GUIDs as a primary key in SQL Server?
I don't want to create the GUID first and save as a variable as we're using ...
102
votes
5
answers
104k
views
What is {{$guid}} used for in Postman?
Postman's official website states that Postman has a few dynamic variables. My question is about:
{{$guid}}: Adds a v4 style guid
What kind of variable is {{$guid}}? How can it be used in test ...
99
votes
9
answers
147k
views
guid/uuid in Typescript Node.js app
I try to make a uuid (v 3.0.1) package work in Node/Typescript app, but I'm not sure what should I import and how to use it.
This is index.d.ts (from @types/uuid v 2.0.29):
declare namespace uuid {
...
99
votes
4
answers
39k
views
Guid.Parse() or new Guid() - What's the difference?
What is the difference between these two ways of converting a string to System.Guid? Is there a reason to choose one over the other?
var myguid = Guid.Parse("9546482E-887A-4CAB-A403-AD9C326FFDA5");
...
98
votes
16
answers
95k
views
What exactly is GUID? Why and where I should use it?
What exactly is GUID? Why and where I should use it?
I've seen references to GUID in a lot of places, and in wikipedia,
but it is not very clear telling you where to use it.
If someone could answer ...
93
votes
10
answers
244k
views
How to convert a GUID to a string in C#?
I'm new to C#.
I know in vb.net, i can do this:
Dim guid as string = System.Guid.NewGuid.ToString
In C#, I'm trying to do
String guid = System.Guid.NewGuid().ToString;
but i get an "Cannot ...
93
votes
2
answers
171k
views
A TypeScript GUID class? [closed]
Does anyone know of a good, solid, implementation of C# like GUID (UUID) in TypeScript?
Could do it myself but figured I'd spare my time if someone else done it before.
93
votes
4
answers
107k
views
How many characters are there in a GUID?
Using ASCII encoding, how many characters are there in a GUID?
I'm interested in the Microsoft style, which includes the curly brackets and dashes.
92
votes
5
answers
81k
views
What are the project GUIDs in a Visual Studio solution file used for?
I have multiple projects in a single Visual Studio (2008) solution.
I just discovered that each of these projects uses a same GUID, so in the solution file it looks like this:
Project("{FAE04EC0-F103-...
92
votes
10
answers
79k
views
How unique is the php session id
How unique is the php session id? I got the impression from various things that I've read that I should not rely on two users never getting the same sessionid. Isn't it a GUID?
89
votes
5
answers
84k
views
How to use Guids in C#?
This Code:
Something = new Guid()
is returning:
00000000-0000-0000-0000-000000000000
all the time and I can't tell why? So, why?
84
votes
6
answers
67k
views
How to declare a constant Guid in C#?
Is it possible to declare a constant Guid in C#?
I understand that I can declare a static readonly Guid, but is there a syntax that allows me to write const Guid?
80
votes
5
answers
167k
views
C# guid and SQL uniqueidentifier
I want to create a GUID and store it in the DB.
In C# a guid can be created using Guid.NewGuid(). This creates a 128 bit integer. SQL Server has a uniqueidentifier column which holds a huge ...
75
votes
14
answers
185k
views
How to create a GUID in Excel?
I need a function to add a GUID to cells in excel. I found this previous question on stackoverflow, but it is not working. It suggests the following function:
=CONCATENATE(DEC2HEX(RANDBETWEEN(0,...
73
votes
7
answers
217k
views
Check if Nullable Guid is empty in c#
Quoting from an answer from this question.
Guid is a value type, so a variable of type Guid can't be null to
start with.
What then if I see this?
public Nullable<System.Guid> SomeProperty ...
72
votes
8
answers
38k
views
What are the performance improvement of Sequential Guid over standard Guid? [closed]
Has someone ever measured performance of Sequential Guid vs. Standard Guid when used as Primary Keys inside a database?
I do not see the need for unique keys to be guessable or not, passing them from ...
69
votes
13
answers
15k
views
Why are there dashes in a .NET GUID?
Why are there dashes in a .NET GUID? Are there dashes in most implementations of a GUID, or is it just a Microsoft thing?
Signed,
741ecf77-9c92-4435-8e6b-85975bd13452
66
votes
11
answers
81k
views
Generate GUID in Windows with batch file
How can I generate a GUID in a batch file running using the commandline in Windows?
65
votes
7
answers
88k
views
What's the C++ version of Guid.NewGuid()?
I need to create a GUID in an unmanaged windows C++ project. I'm used to C#, where I'd use Guid.NewGuid(). What's the (unmanaged windows) C++ version?