Welcome Guest, Not a member yet? Register   Sign In
How to create random, but unique IDs?
#3

[eluser]Steven Ross[/eluser]
Thanks, but those IDs are 13 characters long and in hex, i.e. the contain letters a-f. I'd prefer a purely numeric ID of no more than 8 digits.

Also, from the comments on the manual page:
"this function simply returns the UNIX timestamp with added microsecond counter as a hex number; it's more or less just microtime(), in hexit form"
So, IDs will still be in order small -> large, not random. You can address that with the "added entropy" parameter, but that makes numbers 23 characters - definitely too long for me.


Messages In This Thread
How to create random, but unique IDs? - by El Forum - 05-12-2010, 12:14 PM
How to create random, but unique IDs? - by El Forum - 05-12-2010, 12:34 PM
How to create random, but unique IDs? - by El Forum - 05-12-2010, 01:10 PM
How to create random, but unique IDs? - by El Forum - 05-12-2010, 01:14 PM
How to create random, but unique IDs? - by El Forum - 05-12-2010, 01:34 PM
How to create random, but unique IDs? - by El Forum - 05-12-2010, 01:38 PM
How to create random, but unique IDs? - by El Forum - 05-12-2010, 01:55 PM
How to create random, but unique IDs? - by El Forum - 05-12-2010, 01:59 PM
How to create random, but unique IDs? - by El Forum - 05-12-2010, 02:24 PM
How to create random, but unique IDs? - by El Forum - 05-12-2010, 02:53 PM
How to create random, but unique IDs? - by El Forum - 05-13-2010, 06:49 AM
How to create random, but unique IDs? - by El Forum - 05-13-2010, 01:26 PM
How to create random, but unique IDs? - by El Forum - 05-13-2010, 01:51 PM
How to create random, but unique IDs? - by El Forum - 05-13-2010, 02:45 PM
How to create random, but unique IDs? - by El Forum - 05-13-2010, 07:03 PM
How to create random, but unique IDs? - by El Forum - 05-14-2010, 12:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB