Does this small piece of code seem ok? |
Haha no worries about cross posting. Actually, this thread has opened my eyes on a few things. I never knew about the birthday paradox before reading this and just thought a random 16 digit string would have the same probability of collison (very low).
But when you consider if data strings already exist in the database then the birthday paradox comes into play. Obviously for huge string like GUIDs the birthday paradox is practically insignificant. Also I believe narf's solution is based on generating a truly random number, so it's more the algorithm used that is significant rather than anything else. I'm assuming rand_alnum doesn't make use of php's openssl function thingy which bin2hex does. Also, here's another perplexing question, why does the dots NOT move when you squint your eyes
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
|
Welcome Guest, Not a member yet? Register Sign In |