Guest User

Untitled

a guest
Feb 21st, 2013
787
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function generateRandomString($length) {
  2. $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  3. $randomString = '';
  4. for ($i = 0; $i < $length; $i++) {
  5. $randomString .= $characters[rand(0, strlen($characters) - 1)];
  6. }
  7. return $randomString;
  8. }
  9. $salt = generateRandomString(16);
  10. $sha = 'SHA';
  11. $hash = hash('sha256', hash('sha256', $pass1) . $salt);
  12. $encrypt = '$' . $sha . '$' . $salt . '$' . $hash;
RAW Paste Data