I am having requirement to give my users a function to generate a safe password…
I have the algo in my mind but don’t know how to process with it..
- I will have a set of characters to provide in the password
- I will have control over size of password that means select length
- Select random indices from the array to get passsword of my selcected length…
Last part is what I can’t implement..
Any help will be appreciated…
function randompassword() { // Declaring the function
//Config Start
$salt = "abchefghjkmnpqrstuvwxyz0123456789"; // Your characters bank
$n = "8"; // Number of character to return
//end config
//Logic for password generation..
return $pass;
}
You can try this code..