http://news.utexas.edu/2016/05/16/computer-science-advance-could-improve-cybersecurity Always been quite a challenge but a new way has been found to generate random numbers more evenly with less power.

I recently used a random number generator to generate unique identifiers. The UIDs are 32 bit unsigned numbers. The random generator function returns a double precision number between 0 and 1. When I looked it up, double precision numbers have 53 bits for fractions, which is a lot more than 32. I left shifted the output of the random number generator by 32 bits and rounded to the nearest integer. It seems to work, but I wondered how truly random it was. The other way of implementing UIDs I read about was to just increment the number every time a record was generated, but I was concerned that would be more error prone. The number might get reset somehow. I don't know how, but maybe more than one device might generate them. 32 bits is 4 billion. With say 20 event records generated per day, the chance of getting two identical randomly generated records must be infinitesimal. However, if the numbers are not genuinely random, the chances may be much higher. I heard the boss say he was thinking of reducing the UID number to 16 bits, but I don't like the idea of that much.

This is usually discouraged as people can then guess other UDIs. Typically a date in a good thing to use. Multiply a random number by the h/m/s or unix time stamp can make a less gamable random number.