Questions tagged [uuid]

A UUID (Universally Unique IDentifier) is an identifier that is created with the intent of being, as the name suggests, universally unique.

A UUID (Universally Unique IDentifier) is an identifier that is created with the intent of being, as the name suggests, universally unique.

A UUID is a 16-octet (128-bit) number. In its canonical form, a UUID is represented by 32 hexadecimal digits, displayed in five groups separated by hyphens e.g.

5a0e8422-e29b-41d4-a716-416155440000

UUID is standardised by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE).

Wikipedia page for Universally Unique Identifier

See also:

3237 questions
217
votes
3 answers

Generating v5 UUID. What is name and namespace?

I've read the man page, but I do not understand what name and namespace are for. For version 3 and version 5 UUIDs the additional command line arguments namespace and name have to be given. The namespace is either a UUID in string representation or…
Gajus
  • 69,002
  • 70
  • 275
  • 438
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
192
votes
15 answers

Is there a method to generate a UUID with Go language?

I have code that looks like this: u := make([]byte, 16) _, err := rand.Read(u) if err != nil { return } u[8] = (u[8] | 0x80) & 0xBF // what does this do? u[6] = (u[6] | 0x40) & 0x4F // what does this do? return hex.EncodeToString(u) It…
hardPass
  • 19,033
  • 19
  • 40
  • 42
182
votes
5 answers

How can I generate UUID in C#

I am creating an .idl file programmatically. How do I create UUIDs for the interfaces and Methods Programmatically. Can I generate the UUID programmatically?
Uma Shankar Subramani
  • 1,925
  • 2
  • 12
  • 12
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
164
votes
4 answers

UUID max character length

We are using UUID as primary key for out oracle DB, and trying to determine an appropriate max character length for the VARCHAR. Apparently this is 36 characters but we have noticed UUID'S generated which are longer than this - up to 60 characters…
user1753862
  • 1,679
  • 2
  • 10
  • 4
140
votes
16 answers

When are you truly forced to use UUID as part of the design?

I don't really see the point of UUID. I know the probability of a collision is effectively nil, but effectively nil is not even close to impossible. Can somebody give an example where you have no choice but to use UUID? From all the uses I've…
Pyrolistical
  • 27,624
  • 21
  • 81
  • 106
139
votes
8 answers

How to generate unique id in Dart

I write websocket chat. How to generate unique id for user? now i use this code: id = new DateTime.now().millisecondsSinceEpoch; is there any more neat solution?
Sergey Karasev
  • 4,513
  • 4
  • 25
  • 24
128
votes
1 answer

How big is the chance to get a Java UUID.randomUUID collision?

I need to create some uniques files in Java and i plan to use UUID.randomUUID to generate their names. Is there any chance to get a collision for this? Should i do something like bellow os I shouldn't worry about this? Integer attemptsToGenerateUUID…
daniels
  • 18,416
  • 31
  • 103
  • 173
127
votes
4 answers

Is there any way to generate the same UUID from a String

I am wondering if there is a way to generate the same UUID based on a String. I tried with UUID, it looks like it does not provide this feature.
Adam Lee
  • 24,710
  • 51
  • 156
  • 236
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
120
votes
4 answers

python: how to convert a valid uuid from String to UUID?

I receive the data as { "name": "Unknown", "parent": "Uncategorized", "uuid": "06335e84-2872-4914-8c5d-3ed07d2a2f16" }, and I need to convert the uuid from String to uuid I did not find a way on the python docs, or…
daydreamer
  • 87,243
  • 191
  • 450
  • 722
118
votes
9 answers

Generating 8-character only UUIDs

UUID libraries generate 32-character UUIDs. I want to generate 8-character only UUIDs, is it possible?
M.J.
  • 16,266
  • 28
  • 75
  • 97
117
votes
6 answers

Using a UUID as a primary key in Django models (generic relations impact)

For a number of reasons^, I'd like to use a UUID as a primary key in some of my Django models. If I do so, will I still be able to use outside apps like "contrib.comments", "django-voting" or "django-tagging" which use generic relations via…
mitchf
  • 3,697
  • 4
  • 26
  • 29
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