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
213
votes
8 answers

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?
rustyshelf
  • 44,963
  • 37
  • 98
  • 104
203
votes
4 answers

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 customer but instead have a message like: Internal…
aarona
  • 35,986
  • 41
  • 138
  • 186
188
votes
19 answers

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 design reasons - the expected is not exceptional In…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
167
votes
10 answers

How should I store GUID in MySQL tables?

Do I use varchar(36) or are there any better ways to do it?
CDR
  • 8,198
  • 11
  • 47
  • 46
163
votes
12 answers

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 found online and in the event of a collision, I…
Slick23
  • 5,827
  • 10
  • 41
  • 72
163
votes
5 answers

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?
anchor
  • 1,685
  • 2
  • 11
  • 11
163
votes
11 answers

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 token. Since GUIDs are unique, this is pretty…
Sam Saffron
  • 128,308
  • 78
  • 326
  • 506
162
votes
10 answers

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?
001
  • 62,807
  • 94
  • 230
  • 350
155
votes
19 answers

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 generate a random GUID that has an extremely low…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
136
votes
7 answers

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 optimal way to test a GUID for uniqueness? Bloom filter…
Tom Savage
  • 3,172
  • 4
  • 31
  • 31
134
votes
12 answers

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 tried UPDATE db.tablename SET columnID = UUID() …
Tom
  • 1,353
  • 3
  • 10
  • 7
123
votes
6 answers

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 value for the attribute should remain the…
Punit Vora
  • 5,052
  • 4
  • 35
  • 44
112
votes
10 answers

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?
Acibi
  • 1,737
  • 3
  • 16
  • 22
111
votes
13 answers

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 uids (guids). So these uids should be lightweight…
WHITECOLOR
  • 24,996
  • 37
  • 121
  • 181
111
votes
4 answers

I need to generate uuid for my rails application. What are the options(gems) I have?

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.
Virtual
  • 2,111
  • 5
  • 17
  • 27