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

(10-30-2015, 02:33 PM)iamthwee Wrote: 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.

Just a little correction - bin2hex() just encodes binary data into hexadecimal strings, it's CI_Security::get_random_bytes() that provides the randomness.

Also, the randomness itself is not the result of an algorithm (the uniqueness is).
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 Narf - 10-31-2015, 04:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB