Guest User

Untitled

a guest
Jun 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. Ez ok:
  2. function PasswdGen($lenth) {
  3.     // makes a random alpha numeric string of a given lenth
  4.     $aZ09 = array_merge(range('A', 'Z'), range('a', 'z'),range(0, 9));
  5.     $out ='';
  6.     for($c=0;$c < $lenth;$c++) {
  7.        $out .= $aZ09[mt_rand(0,count($aZ09)-1)];
  8.     }
  9.     return $out;
  10. }
  11.  
  12. Ez Több helyen is X@rul működik:
  13.  
  14. function PasswdGen_2($chcount){
  15.     $totalChar = $chcount;
  16.     $salt = "1234567890qwertzuiopasdfghjklyxcvbnmQWERTZUIOPASDFGHJKLYXCVBNM";
  17.     srand((double)microtime()*1000000);
  18.     $user_passwd="";
  19.     for($i=0;$i<$totalChar;$i++){
  20.         $user_passwd=$user_passwd . substr($salt,rand()%strlen($salt),1);
  21.     }
  22.     return $user_passwd;
  23. }
Add Comment
Please, Sign In to add comment