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
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
609
votes
12 answers

Generating a UUID in Postgres for Insert statement?

My question is rather simple. I'm aware of the concept of a UUID and I want to generate one to refer to each 'item' from a 'store' in my DB with. Seems reasonable right? The problem is the following line returns an error: honeydb=# insert into items…
fIwJlxSzApHEZIl
  • 11,861
  • 6
  • 62
  • 71
461
votes
6 answers

Which UUID version to use?

Which version of the UUID should you use? I saw a lot of threads explaining what each version entails, but I am having trouble figuring out what's best for what applications.
user1802143
  • 14,662
  • 17
  • 46
  • 55
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
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
358
votes
9 answers

How good is Java's UUID.randomUUID?

I know that randomized UUIDs have a very, very, very low probability for collision in theory, but I am wondering, in practice, how good Java's randomUUID() is in terms of not having collision? Does anybody have any experience to share?
Alvin
  • 10,308
  • 8
  • 37
  • 49
306
votes
19 answers

PHP function to generate v4 UUID

So I've been doing some digging around and I've been trying to piece together a function that generates a valid v4 UUID in PHP. This is the closest I've been able to come. My knowledge in hex, decimal, binary, PHP's bitwise operators and the like is…
anomareh
  • 5,294
  • 4
  • 25
  • 22
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
262
votes
6 answers

When should I use uuid.uuid1() vs. uuid.uuid4() in python?

I understand the differences between the two from the docs. uuid1(): Generate a UUID from a host ID, sequence number, and the current time uuid4(): Generate a random UUID. So uuid1 uses machine/sequence/time info to generate a UUID. What are the…
rocketmonkeys
  • 5,473
  • 5
  • 28
  • 21
246
votes
5 answers

Likelihood of collision using most significant bits of a UUID in Java

If I'm using Long uuid = UUID.randomUUID().getMostSignificantBits() how likely is it to get a collision. It cuts off the least significant bits, so there is a possibility that you run into a collision, right?
dlinsin
  • 19,249
  • 13
  • 42
  • 53
218
votes
10 answers

Efficient method to generate UUID String in Java (UUID.randomUUID().toString() without the dashes)

I would like an efficient utility to generate unique sequences of bytes. UUID is a good candidate but UUID.randomUUID().toString() generates stuff like 44e128a5-ac7a-4c9a-be4c-224b6bf81b20 which is good, but I would prefer dash-less string. I'm…
Maxim Veksler
  • 29,272
  • 38
  • 131
  • 151
218
votes
10 answers

How to get a unique device ID in Swift?

How can I get a device's unique ID in Swift? I need an ID to use in the database and as the API-key for my web service in my social app. Something to keep track of this devices daily use and limit its queries to the database.
User
  • 23,729
  • 38
  • 124
  • 207
1
2 3
99 100