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
109
votes
6 answers

How do I convert a Python UUID into a string?

I need to be able to assign a UUID to a user and document this in a .txt file. This is all I have: import uuid a = input("What's your name?") print(uuid.uuid1()) f.open(#file.txt) I tried: f.write(uuid.uuid1()) but nothing comes up, may be a…
Alphin Philip
  • 1,109
  • 2
  • 8
  • 6
109
votes
11 answers

UUID performance in MySQL?

We're considering using UUID values as primary keys for our MySQL database. The data being inserted is generated from dozens, hundreds, or even thousands of remote computers and being inserted at a rate of 100-40,000 inserts per second, and we'll…
Patrick Lightbody
  • 4,424
  • 2
  • 28
  • 38
105
votes
3 answers

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-165B-4CA0-909B-C86B9CEE0111
Fidel
  • 7,027
  • 11
  • 57
  • 81
104
votes
2 answers

Example of UUID generation using Boost in C++

I want to generate just random UUID's, as it is just important for instances in my program to have unique identifiers. I looked into Boost UUID, but I can't manage to generate the UUID because I don't understand which class and method to use. I…
Nikola
  • 1,406
  • 2
  • 16
  • 20
104
votes
5 answers

Using UUIDs in SQLite

Is it possible to use UUID values as a primary key in SQLite? I'm finding extremely limited information on the topic, so I'm not sure if SQLite even supports a UUID data type. Should I be storing a UUID as a string?
Mike Baxter
  • 6,868
  • 17
  • 67
  • 115
101
votes
8 answers

What is a UUID?

Well, what is one?
doctor smith
100
votes
7 answers

Is Secure.ANDROID_ID unique for each device?

I am using this call: Secure.getString(getApplicationContext().getContentResolver(), Secure.ANDROID_ID); To get a UID for the device. I think I am getting the same ID from multiple devices though. Should this be possible? The ID in question is:…
FoamyGuy
  • 46,603
  • 18
  • 125
  • 156
97
votes
6 answers

Collisions when generating UUIDs in JavaScript

This relates to this question. I am using the code below from this answer to generate a UUID in JavaScript: 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); …
Muxa
  • 5,563
  • 6
  • 46
  • 56
97
votes
6 answers

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 { interface V1Options { node?: number[]; …
tBlabs
  • 2,619
  • 3
  • 18
  • 22
94
votes
11 answers

Storing UUID as base64 String

I have been experimenting with using UUIDs as database keys. I want to take up the least amount of bytes as possible, while still keeping the UUID representation human readable. I think that I have gotten it down to 22 bytes using base64 and…
mainstringargs
  • 13,563
  • 35
  • 109
  • 174
90
votes
2 answers

A TypeScript GUID class?

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.
Gustav
  • 3,408
  • 4
  • 24
  • 41
90
votes
7 answers

Android: How do bluetooth UUIDs work?

I don't understand what a bluetooth UUID denotes. Do UUIDs denote protocols (e.g. RFCOMM)? If so, why do the createRfcommSocketToServiceRecord() methods require UUIDs, when they specify rfcomm right in their names? Why does the BluetoothChat sample…
ForeverWintr
  • 5,492
  • 2
  • 36
  • 65
87
votes
5 answers

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-D311-BF4B-00C04FCBFE97}") = "Pro1",…
Marc
  • 9,012
  • 13
  • 57
  • 72
86
votes
8 answers

Using Hibernate UUIDGenerator via annotations

I'm using my uuid as following: @Id @GeneratedValue(generator = "uuid") @GenericGenerator(name = "uuid", strategy = "uuid") @Column(name = "uuid", unique = true) private String uuid; but I'm getting a smart Hibernate warning: Using …
Martin
  • 1,460
  • 1
  • 13
  • 17
85
votes
7 answers

Is there a 128 bit integer in C++?

I need to store a 128 bits long UUID in a variable. Is there a 128-bit datatype in C++? I do not need arithmetic operations, I just want to easily store and read the value very fast. A new feature from C++11 would be fine, too.
danijar
  • 32,406
  • 45
  • 166
  • 297