Roy Tang

Programmer, engineer, scientist, critic, gamer, dreamer, and kid-at-heart.

Blog Notes Photos Links Archives About

Why not just use the current time (as an integer)?

Posted by under notes at #jquery
Also on: stackexchange / 3

Comments

Depending upon the lifetime you have to operate over, 8 digits may not be enough and if you need a whole bunch of random numbers quickly, the current time may not advance fast enough. Time is generally a good thing to use for a non-repeating unique number, but the 8 digit limitation might handicap that for this particular use.
This will not be 8 characters long.
Great idea just pared it with jQuery, as the date with the integers in the date that won’t be the same over time. Very Good Idea!