daily pastebin goal
54%
SHARE
TWEET

Untitled

a guest Sep 12th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top