Created
March 8, 2016 17:38
-
-
Save lukehoersten/6dea9cfc695bb76b4e7b to your computer and use it in GitHub Desktop.
BCrypt hash example in Haskell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Crypto.BCrypt (hashPasswordUsingPolicy) | |
| import Data.ByteString.Char8 (ByteString, pack) | |
| hash :: String -> IO (Maybe ByteString) | |
| hash = hashPasswordUsingPolicy hp . pack | |
| where hp = HashingPolicy 12 $ pack "$2y$" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment