Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #per: http://stackoverflow.com/a/853882/747749
- #test generating a random string with concatenation. 100,000 runs
- time php -r 'function r($length = 16, $charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") {$str = "";$count = strlen($charset);while ($length--) {$str .= $charset[mt_rand(0, $count-1)];}echo $str.PHP_EOL;}for($i=0;$i<100000;$i++)r();' > /dev/null
- #test generating a random string with implode. 100,000 runs
- time php -r 'function r($length = 16, $charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") {$count = strlen($charset);while ($length--) {$str[] = $charset[mt_rand(0, $count-1)];}echo implode($str).PHP_EOL;}for($i=0;$i<100000;$i++)r();' > /dev/null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement