CodeIgniter Forums

Full Version: function random_string in string_helper
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
PHP Code:
return substr(str_shuffle(str_repeat($poolceil($len strlen($pool)))), 0$len); 


Is not better with this way:    substr(str_shuffle($pool), 0, $len);
it is even faster than substr(str_shuffle(str_repeat($pool, ceil($len / strlen($pool)))), 0, $len);  ??
It's not clear what your question is. What do you want to know about random_string() ?
He wants to suggest changes to it.

No, these changes don't make it better.
In fact, nothing will make it better.

That function is fundamentally broken.