Mercurial > hg > ywww
view user/passGen.php @ 49:a67bf725e87b
put both paths in include_path and depend on that
author | Charlie Root |
---|---|
date | Wed, 16 Jan 2019 13:42:15 -0500 |
parents | 077b0a0a3e6d |
children |
line wrap: on
line source
<?php function generatePassword($length=9) { $vowels = 'aeuy'; $consonants = 'bdghjmnpqrstvz'; $consonants .= 'BDGHJLMNPQRSTVWXZ'; $vowels .= "AEUY"; $consonants .= '23456789'; $consonants .= '@#$%'; $password = ''; $alt = time() % 2; for ($i = 0; $i < $length; $i++) { if ($alt == 1) { $password .= $consonants[(rand() % strlen($consonants))]; $alt = 0; } else { $password .= $vowels[(rand() % strlen($vowels))]; $alt = 1; } } return $password; } ?>