Skip to content

Instantly share code, notes, and snippets.

@grim-reapper
Forked from AndrewChamp/keygen.php
Created December 24, 2018 06:12
Show Gist options
  • Select an option

  • Save grim-reapper/128a3c26098351146e0da962e90cfe53 to your computer and use it in GitHub Desktop.

Select an option

Save grim-reapper/128a3c26098351146e0da962e90cfe53 to your computer and use it in GitHub Desktop.
Random Keygen
<?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