Created
September 29, 2015 02:57
-
-
Save AndrewChamp/7c1c6c53db5bb4df4687 to your computer and use it in GitHub Desktop.
Random Keygen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function keygen($length='40'){ | |
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
$size = strlen($chars); | |
for($i = 0; $i < $length; $i++): | |
$str .= $chars[ rand( 0, $size - 1 ) ]; | |
endfor; | |
return $str; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment