[program-l] Re: PW Generators

  • From: "Jacob Kruger" <jacob@xxxxxxxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>
  • Date: Wed, 24 Oct 2012 21:03:57 +0200

Here's my random password generating function have made use of on a couple of 
sites - PHP:
function randomString($iLen) {
$arAlpha = str_split("abcdefghijklmnopqrstuvwxyz");
$arNumeric = str_split("1234567890");
$sOut = "";
for ($I = 0; $I < $iLen; $I++) {
if (rand(0, 1) == 0) {
if (rand(0, 1) == 0) {
$sOut .= $arAlpha[array_rand($arAlpha)];
} else {
$sOut .= strtoupper($arAlpha[array_rand($arAlpha)]);
}
} else {
$sOut .= $arNumeric[array_rand($arNumeric)];
}
}//end of looping
return $sOut;
}//end of randomString function

It randomly chooses between lowercase, uppercase and numeric characters to be 
included in a string the length of which you ask it to return.

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

  ----- Original Message ----- 
  From: Homme, James 
  To: program-l@xxxxxxxxxxxxx 
  Sent: Wednesday, October 24, 2012 7:33 PM
  Subject: [program-l] PW Generators


  Hi,

  I need to generate a hard to guess pw that doesn't need to be perfect, just 
difficult to guess as a one time pw on a site that someone can change the first 
time they log on. The Drupal site I administer wants me to type it into a pw 
edit field, so I was hoping to just find something that could generate a text 
string that I can paste. Is there such a thing?



  Thanks.



  Jim









------------------------------------------------------------------------------

  This e-mail and any attachments to it are confidential and are intended 
solely for use of the individual or entity to whom they are addressed. If you 
have received this e-mail in error, please notify the sender immediately and 
then delete it. If you are not the intended recipient, you must not keep, use, 
disclose, copy or distribute this e-mail without the author's prior permission. 
The views expressed in this e-mail message do not necessarily represent the 
views of Highmark Inc., its subsidiaries, or affiliates.

Other related posts: