I need to generate unique ids for my application and I am looking for suitable algorithms. I would prefer something like this --
YYYY + MM + DD + HH + MM + SS + <random salt> + <something derived from the preceding values>
F.ex. -
20100128184544ewbhk4h3b45fdg544
I was thinking about using SHA-256 or something but the resultant string...
I am using Java EE and the Spring framework. I am writing my POJOs, and the base object for my system should have a globally unique ID. My question is: what would be a "best-practice" way for me to generate this ID. This id must also be stored in a db table as a primary key.
...
I am trying to get the first part of a Guid Field with the TSQL substring function as follows
SELECT SUBSTRING(Guid, 1, 8) AS Gu FROM MyTable
but all i get is this error.
Argument data type uniqueidentifier is invalid for argument 1 of substring function.
So what is going on here? Should i treat the Guid as pure string first or...?
...
How to generate unique ID that is integer in java ?
...
Hi,
I have a table with a column of unique string values. The max length of the string value is 255 char. I want to generate a unique id with the string value as input. In other words I am looking for a compact representation for a string. The unique id generated can be alpha-numeric. A useful feature to have would be to be able to reg...
Hello guys
I want create an encryption with java ; How can i get CPU Id or anythings is unique in pc such as bios or ...
for example System.getCpuId(); :) it's just example ;)
Thanks a lot ...
...
In other words, is there an ID for each and every mobile phone--that makes it different.
No two phones can have the same ID. (I'm talking about smartphones ...android, iphone, etc)
...
I wonder if there is any way to retrieve, for both a server and a client connected through ssh (OpenSSH), some unique session identifier (let this be USID).
This would be used to restrict the execution of a specific (custom) software (let it be a.exe), so it can only be executed through a specific ssh session, even if other users (poten...
When a user adds a new item in my system, I want to produce a unique non-incrementing pseudo-random 7-digit code for that item. The number of items created will only number in the thousands (<10,000).
Because it needs to be unique and no two items will have the same information, I could use a hash, but it needs to be a code they can sh...
What I am trying to do is create a 12 character id for articles on my website similar to how youtube handles their video id (http://www.youtube.com/watch?v=53iddd5IcSU). Right now I am generating an MD5 hash and then grabbing 12 characters of it like this:
$ArticleId = substr(MD5("Article".$currentID),10,12)
where $currentID is the nu...
I want a script in PHP and c# which will generate id's like the following sites are doing:
Youtube http://www.youtube.com/watch?v=OdAE3cWlmHw is doing it like OdAE3cWlmHw
Bit.ly http://bit.ly/2pUswX doing it like 2pUswX
What will be the function to generate such type of unique id's in PHP and c#?
...
hey all,
i have a table which has a primary key (UserID) this is of type UniqueIdentifier.
im trying to insert a value into this field but i keep getting an error.
i want to get the userID of the current user and insert the into the user_Details table, but i keep getting this error
Conversion failed when converting from a character s...
I ‘concat’ an id of just loaded image into mysql user record like this.
Userid … Photos_ids
12 1 2 5 7
And this photo_id should be unique. (To create unique file name). Now I get a current last id from memcache. But it's not really safely, as far as I understand.
It there any other ideas? (I do not add any other records int...
Is this a correct way for id generation in MySQL ?
INSERT INTO Picture
(PictureId,First_pick,Title,Description,File_Name,Is_Vertical)VALUES
((SELECT max(pictureid)+1 FROM Picture),0,?,?,?,?)
I mean if it is guaranted that PictureId will be unique when this query is run by many threads ?
I can't modify table structure. Should I...
How do I create unique key value in PHP?
I need simple unique keys with a length of 20 digits (not more than 33).
...
What is the best way to generate a unique ID in java. People generally use
String id = System.currentTimeMillis+ someStaticCounter;
But this approach would require synchronization in multithreaded applications.
I am using
try
{
Thread.sleep(1);
//This sleep ensures that two consecutive calls from the same thread does not re...
I am building a secure app for our exec's... here is my setup. It's a somewhat Macgyver approach, but bear with me :)
There are only 10 users, I have a record of each uniqueIdentifier on my backend in a database table. (This is internal only for our users, so I don't believe I am breaking the public user registration rule mentioned in ...
Im aware that MD5 has had some collisions but this is more of a high level question about hashing functions. If MD5 hashes any arbitrary string into a 32-digit hex value, then according to the Pigeonhole Principle surely this can not be unique as there are more unique arbitrary strings than there are unique 32-digit hex values
...
I'm working on an app that sends raw data to zebra printer and print out barcodes. And since every item has its own unique barcode, I need to define a variable that automatically generates unique number of 12 digits long.
see example:
printBar prnt = new printBar("123456789012");
Is there anyway to define a double variable and pass i...
I am writing a message transfer program between multiple clients and server.
I want to generate a unique message ID for every message. It should be generated by the server and returned to the client.
For message transfer, I am using a hash data structure, for example:
{
api => POST,
username => sganesh,
pass => "pass",
message => "hai...