Advertisement
Guest User

Untitled

a guest
Oct 8th, 2011
1,367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. //From inc/admin/pwtool.php:
  2. echo "Strong Password: " . '<span style="color:#f00;">' . make_password(15) . "</span>";
  3.  
  4.  
  5. //From libs/functions.php:
  6. if (!function_exists('make_password')) :
  7.     /**
  8.      * @public
  9.      * @uses make_seed()
  10.      * Generate a strong password
  11.      * @return string
  12.      */
  13.     function make_password($password_length)
  14.     {
  15.         srand(make_seed());
  16.         $alfa = "!@123!@4567!@890qwer!@tyuiopa@!sdfghjkl@!zxcvbn@!mQWERTYUIO@!PASDFGH@!JKLZXCVBNM!@";
  17.         $token = "";
  18.         for($i = 0; $i < $password_length; $i ++) {
  19.           $token .= $alfa[rand(0, strlen($alfa))];
  20.         }
  21.         return $token;
  22.     }
  23. endif;
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement