Questions tagged [uniqueidentifier]

With reference to a given (possibly implicit) set of objects, a unique identifier is any identifier which is guaranteed to be unique among all identifiers used for those objects and for a specific purpose.

Overview

When dealing with a set of objects, a unique identifier is any identifier that is designed to be unique among all identifiers used for those objects within a given range, scope or purpose.

1591 questions
3064
votes
54 answers

Is there a unique Android device ID?

Do Android devices have a unique ID, and if so, what is a simple way to access it using Java?
Tyler
  • 31,237
  • 8
  • 21
  • 22
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
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
487
votes
31 answers

How to generate a random, unique, alphanumeric string?

How would it be possible to generate a random, unique string using numbers and letters for use in a verify link? Like when you create an account on a website, and it sends you an email with a link, and you have to click that link in order to verify…
Andrew
  • 227,796
  • 193
  • 515
  • 708
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
215
votes
11 answers

How do I create a unique ID in Java?

I'm looking for the best way to create a unique ID as a String in Java. Any guidance appreciated, thanks. I should mention I'm using Java 5.
Supertux
  • 8,088
  • 10
  • 42
  • 47
167
votes
10 answers

Hash function that produces short hashes?

Is there a way of encryption that can take a string of any length and produce a sub-10-character hash? I want to produce reasonably unique ID's but based on message contents, rather than randomly. I can live with constraining the messages to…
user234932
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
129
votes
22 answers

.NET Short Unique Identifier

I need a unique identifier in .NET (cannot use GUID as it is too long for this case). Do people think that the algorithm used here is a good candidate or do you have any other suggestions?
Noel
  • 5,037
  • 9
  • 46
  • 69
129
votes
7 answers

Convert varchar to uniqueidentifier in SQL Server

A table I have no control of the schema for, contains a column defined as varchar(50) which stores uniqueidentifiers in the format 'a89b1acd95016ae6b9c8aabb07da2010' (no hyphens) I want to convert these to uniqueidentifiers in SQL for passing to a…
grenade
  • 31,451
  • 23
  • 97
  • 126
113
votes
4 answers

How to choose the id generation strategy when using JPA and Hibernate

I was going through Id generation section of the Hibernate reference guide and "java persistence with Hibernate" There are quite a few options available with Hibernate and JPA combined. I was looking for a further documentation on how to choose the…
user1317764
112
votes
14 answers

Generating a unique machine id

I need to write a function that generates an id that is unique for a given machine running a Windows OS. Currently, I'm using WMI to query various hardware parameters and concatenate them together and hash them to derive the unique id. My question…
HS.
  • 15,442
  • 8
  • 42
  • 48
106
votes
4 answers

How to delete from select in MySQL?

This code doesn't work for MySQL 5.0, how to re-write it to make it work DELETE FROM posts where id=(SELECT id FROM posts GROUP BY id HAVING ( COUNT(id) > 1 )) I want to delete columns that dont have unique id. I will add that most of the time its…
IAdapter
  • 62,595
  • 73
  • 179
  • 242
104
votes
5 answers

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 sequential GUIDs as our primary keys. Any idea on what the…
handles
  • 7,639
  • 17
  • 63
  • 85
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
1
2 3
99 100