Created
November 15, 2021 17:53
-
-
Save exitcas/9bf40938d0112b3b3db1f73440bc492c to your computer and use it in GitHub Desktop.
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 /* Key generator */ | |
function genKey($n) { | |
$chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz;!#$?%:*,_."; | |
$id = ''; $thing=0; | |
for ($i=0; $i<$n; $i++) { | |
$r = rand(0, strlen($chars)-1); | |
$id .= $chars[$r]; | |
} | |
return $id; | |
} | |
if(isset($_GET["k"])){$key=$_GET["k"];}else{$key = genKey(9);} echo $key."<br>".password_hash($key, PASSWORD_DEFAULT); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment