Answer the question
In order to leave comments, you need to log in
Are there ways to generate a unique ID for a client, not in UUID or GUID format, but a simple integer?
Are there ways to generate a unique ID for a client, not in UUID or GUID format, but a simple integer?
Answer the question
In order to leave comments, you need to log in
INT field with AUTO_INCREMENT in the database.
Most likely it is already there.
C# has the ability to create a unique int using System.Threading.Interlocked.Increment.
It looks like this:
private static int tick = Environment.TickCount;
public int Id
{
get{return Interlocked.Increment(ref tick);}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question