SHARE
TWEET

Untitled




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- <?php
- /**
- * Creates a Blowfish hash for the provided text and salt.
- *
- * @param string $text The text to be hashed.
- * @param string $salt A salt to use for the hash.
- *
- * @return string A 32 character hash.
- */
- function getHash($text, $salt) {
- assert(TRUE === is_string(base64_encode($text)));
- assert(TRUE === is_string($salt));
- $return = substr(crypt($text, $salt), -32);
- return $return;
- }
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.