Created
June 19, 2010 18:47
-
-
Save alexedwards/445157 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
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
Simple Password - Returns a simple pronouncable passphrase. | |
Examples: Motir27, Wesag97, Muvak41 | |
Rated as 'good' by http://www.passwordmeter.com/ | |
@access public | |
@return string | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ | |
function simple_password() { | |
$vowels = array ("a","e","i","o","u"); | |
$consonants = array ("b","c","d","f","g","h","k","l","m","n","p","r","s","t","v","w","z"); | |
$CI =& get_instance(); | |
$CI->load->helper("array"); | |
return strtoupper(random_element($consonants)) . random_element($vowels) . random_element($consonants) . random_element($vowels) . random_element($consonants) . (string) rand(10,99); | |
} | |
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
Strong Password - Returns a strong passphrase. | |
Examples: Kusid+109, Nitig-580, Gigom!899 | |
Rated as 'very strong' by http://www.passwordmeter.com/ | |
@access public | |
@return string | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ | |
function strong_password() { | |
$symbols = array ("!","$","@","#","?","=",":","+","-","_"); | |
$vowels = array ("a","e","i","o","u"); | |
$consonants = array ("b","c","d","f","g","h","k","l","m","n","p","r","s","t","v","w","z"); | |
$CI =& get_instance(); | |
$CI->load->helper("array"); | |
return strtoupper(random_element($consonants)) | |
. random_element($vowels) | |
. random_element($consonants) | |
. random_element($vowels) | |
. random_element($consonants) | |
. random_element($symbols) | |
. (string) rand(100,999); | |
} | |
/* End of file password_helper.php */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment