get_random_bytes() bad resut? |
HI! I try with $this->security->get_random_bytes(64) on CI3 on last commit, get a string with 64 chars, but only return an unreadable string with strangly codes and a lot of blank spaces.
To use this feature, server needs a special library installed? Thanks.
If it failed, it would return FALSE. I'm not sure what you're expecting to receive from get_random_bytes() other than a string of random bytes the requested length...
(08-19-2015, 12:55 PM)ivantcholakov Wrote: It returns bytes, not characters... Not necessarily printable ASCII characters, to be more precise. To make the result easier to work with (i.e. easy to copy into a config file), it may be converted to a hex string via bin2hex() and then unpacked via hex2bin() when used. |
Welcome Guest, Not a member yet? Register Sign In |