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;
- }
Add Comment
Please, Sign In to add comment