...

View Full Version : Dynamic and unique number generation?



fireblade
07-15-2007, 01:03 PM
How can i create a random and a little long unique number that is miz of numbers and letters??

ess
07-15-2007, 03:02 PM
Here is a good example
http://lab.artlung.com/make-unique-id/

Cheers,
Ess

rafiki
07-15-2007, 03:50 PM
people here have said numerous times mktime() can create a totally unique random number, re-search the forums and look for a solution

NancyJ
07-15-2007, 04:03 PM
people here have said numerous times mktime() can create a totally unique random number, re-search the forums and look for a solution

mktime wouldnt be random or contain letters. Timestamps are unique-ish but for with high traffic you could get 500-1000 all with the exact same timestamp. If you're using a timestamp as the basis of your random number use microtime instead, you're 1,000,000 times more likely to get a unique value than with time or mktime.

You could start with microtime as the basis of your unique then randomly select certain digits to convert to a letter (between A and J). It would be unique and contain both letters and numbers but it would be pretty long.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum