All pastes #24229 Raw Edit

Derek

public php v1 · immutable
#24229 ·published 2005-09-29 20:41 UTC
rendered paste body
// Random Password Generator usage: $NewPass = RandPass(); or $NewPass2 = RandPass(6); for 6 charfunction RandPass($n=8,$chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'){  srand((double)microtime()*1000000);  $m=strlen($chars);  $i=$n;  while(--$i){    $x .= substr($chars,rand() % $m,1);  }  return $x;}//onelinerfunction RandPass($n=8,$chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'){srand((double)microtime()*1000000);$m=strlen($chars);$i=$n;while(--$i){$x.=substr($chars,rand()%$m,1);}return $x;}