Guest User

Untitled

a guest
Sep 12th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. <?php
  2. /**
  3. * Creates a Blowfish hash for the provided text and salt.
  4. *
  5. * @param string $text The text to be hashed.
  6. * @param string $salt A salt to use for the hash.
  7. *
  8. * @return string A 32 character hash.
  9. */
  10. function getHash($text, $salt) {
  11. assert(TRUE === is_string(base64_encode($text)));
  12. assert(TRUE === is_string($salt));
  13. $return = substr(crypt($text, $salt), -32);
  14. return $return;
  15. }
Add Comment
Please, Sign In to add comment