Skip to content

Instantly share code, notes, and snippets.

@lukehoersten
Created March 8, 2016 17:38
Show Gist options
  • Save lukehoersten/6dea9cfc695bb76b4e7b to your computer and use it in GitHub Desktop.
Save lukehoersten/6dea9cfc695bb76b4e7b to your computer and use it in GitHub Desktop.
BCrypt hash example in Haskell
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