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.

1464 questions
2895
votes
50 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
  • 29,539
  • 8
  • 19
  • 22
815
votes
8 answers

How to create a GUID/UUID in Python

How do I create a GUID 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
  • 15,080
  • 8
  • 34
  • 40
522
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
  • 15,436
  • 20
  • 71
  • 112
427
votes
28 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
  • 196,883
  • 184
  • 487
  • 673
193
votes
8 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
  • 20,562
  • 35
  • 99
  • 185
189
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
  • 7,198
  • 10
  • 39
  • 46
117
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
113
votes
6 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
  • 28,964
  • 22
  • 90
  • 125
105
votes
15 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.
  • 14,004
  • 8
  • 36
  • 46
105
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
102
votes
23 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
  • 4,214
  • 6
  • 37
  • 62
97
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…
bplus
  • 7,177
  • 13
  • 59
  • 83
87
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
  • 55,820
  • 69
  • 166
  • 236
83
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
  • 45,328
  • 16
  • 118
  • 151
72
votes
8 answers

How to preserve identifierForVendor in ios after uninstalling ios app on device?

I am developing an iOS app which calls web-service for login and at that time i send login credentials to web server along with vendor identifier (identifierForVendor),to identify device uniquely for those credentials.So user can have only one…
Harshavardhan
  • 1,206
  • 1
  • 14
  • 20
1
2 3
97 98