Anything related to the generation and management of unique identifiers, i.e. pieces of information (such as strings, numbers, etc.) that (must/can) have no duplicate in some context (e.g. process IDs in a running PC, primary keys in a database table, user names in a networked system, etc.).
Questions tagged [unique-id]
184 questions
201
votes
8 answers
How can I generate a unique ID in Python?
I need to generate a unique ID based on a random value.

Ryan
- 11,743
- 16
- 37
- 37
182
votes
16 answers
Vue.js: How to set a unique ID for each component instance?
I want to create a component with Vue.js containing a label and an input. For example :
How can I set a unique ID for each component instance?

PierreB
- 1,947
- 3
- 16
- 16
102
votes
5 answers
JavaScript Object Id
Do JavaScript objects/variables have some sort of unique identifier? Like Ruby has object_id. I don't mean the DOM id attribute, but rather some sort of memory address of some kind.

treznik
- 7,955
- 13
- 47
- 59
34
votes
16 answers
How to get One Signal unique user id in Mobile?
I am developing a restaurant app. I am using One Signal in my app to send notifications. Here while I place the order I need to send the unique Id of the one signal for a specific user for getting notification of "Your Order is placed…

Parama Sudha
- 2,583
- 3
- 29
- 48
22
votes
2 answers
C# asp.net Why is there a difference between ClientID and UniqueID?
I know ClientID is used for javascript and UniqueId for server side and that ClientID uses an underscore (_) and UniqueId uses a dollar sign ($) in asp.net 2.0. But what I don't get is why use two different id's. Why isn't possible to just OR use…

Martijn
- 24,441
- 60
- 174
- 261
15
votes
3 answers
Get Computer Unique ID from PHP
I've created an application using PHP and I'm going to sell it to my local market. I will personally be going to their locations to install/configure Apache & MySQL as well as installing my own code.
I would like a security system so that if anyone…

Tito
- 663
- 1
- 8
- 14
13
votes
2 answers
SQL (Java, h2): What's the best way to retrieve the unique ID of the single item I just inserted into my database?
My current method is this:
SELECT TOP 1 ID FROM DATAENTRY ORDER BY ID DESC
This assumes the latest inserted item always has the highest unique ID (primary key, autoincrementing). Something smells wrong here.
Alternatives?

Daddy Warbox
- 4,500
- 9
- 41
- 56
10
votes
3 answers
calculate an unique id from an array/class
I use a data class to feed templates my data, I want to calculate a unique id from the data in the data class so I can check if the template with that data is already in cache and then serve that version.
so a function to get an unique id from an…

Paul Scheltema
- 1,993
- 15
- 25
10
votes
4 answers
Why does PHPs uniqid function return only 13 digits and not 14?
uniqid() function returns a 13 digits long hexadecimal number. According to the spec in php.net site, the function uses microtime to generate the unique value.
But microtime returns numbers in string format as the following one:
"0.70352700…

Marco Demaio
- 33,578
- 33
- 128
- 159
8
votes
4 answers
How do I get a unique identifier for a machine running Windows 8 in C#?
I'm working on a Metro app written in C# and need a way to uniquely identify a device. I found the ASHWID in the documentation which looks great. The code suggested is as follows:
HardwareToken token =…

StarlitSkies
- 1,144
- 7
- 14
6
votes
4 answers
How to create unique image ID each time upload is pressed using Flutter/Firebase?
I'm trying to make an image upload button and link it to Firebase such that each time the button is pressed, the image is sent to Firebase Storage. Here are the relevant snippets of my code:
// Files, and references
File _imageFile;
…

Zakenmaru
- 63
- 2
- 5
6
votes
2 answers
Error "Found 3 elements with non-unique id #input"
I'm using Polymer with Chrome 63.0.3239.108 (updated this morning) and I got some new errors while launching my webapp:
[DOM] Found 3 elements with non-unique id #input
Here's my code :
…

user3197506
- 197
- 1
- 2
- 14
6
votes
1 answer
How can I get Device Unique Id for windows phone 8.1?
I want Unique Device Id for back_end service (ws) for that I found following reference
private string GetDeviceId()
{
var token = Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken(null);
var hardwareId =…

Kushal Maniyar
- 846
- 1
- 8
- 26
6
votes
1 answer
Creation of unique type ID with c++11
Why is the following code guaranteed to be a unique typeID ?!
using TypeId = uintptr_t;
template < typename T >
static TypeId GetTypeId()
{
static uint32_t placeHolder;
return (reinterpret_cast(&placeHolder));
}
Source
I don't…

lifeOfPI
- 318
- 1
- 8
5
votes
1 answer
Eventing in Liferay Portlets
In any portlet application, if the same page containing a portlet is opened in two browser tabs, how is the event in the first page distinguished from the second page?
I want to assign a unique Id for each event, store it and append it to the URL so…

Ravi
- 2,472
- 3
- 20
- 26