Welcome Guest, Not a member yet? Register   Sign In
Does this small piece of code seem ok?
#14

(This post was last modified: 10-30-2015, 02:34 PM by ignitedcms.)

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 Wink
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
Reply


Messages In This Thread
Does this small piece of code seem ok? - by PaulD - 10-30-2015, 09:02 AM
RE: Does this small piece of code seem ok? - by ignitedcms - 10-30-2015, 02:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB