Created
August 2, 2018 22:31
-
-
Save quisido/ad2575bb261cf896b6051c41f4c4bfd1 to your computer and use it in GitHub Desktop.
Establishing a Secure Password Generator for Your User Base
This file contains 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 | |
$characters = | |
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' . | |
'0123456789`~!@#$%^&*()_-+=[{]}|;:,.<>/?'; | |
$strlen_characters = strlen($characters); | |
function password($length) { | |
$temp = ""; | |
for ($x = 0; $x < $length; $x++) | |
$temp .= $characters[rand(0, $strlen_characters - 1)]; | |
return $temp; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment