How unique are the strings the following code produces gonna be?
substr(md5(md5(time())),0,10);
I hash the hash 'cause the line right before this one hashes time() as well and I want to make sure the two strings are not equivalent.
The way I see it, there are (26+10)10 (or 3,656,158,440,062,976 -- 3.6 QUADrillion) possibilities. Given that the site expects only about 10,000 users, I'd be pretty safe ensuring that each user has a unique (and pseudorandom) string associated with their account. Safe assumption?
My only worry is that the md5 algorithm may return two hashes that have the same 10 character substring to start. Any thoughts on that?
One work-around (kinda) for that would be to set the user's registration key to, say, 0000000000 once they have completed registration. That will help cut down the possibility of two users who have not completed the registration process having the same registration key at any given time.