From f362d50d46bc9d9081d2076f12c034d9002cd2b7 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Thu, 25 Feb 2016 07:48:30 +0000 Subject: [PATCH] [bcrypt] make the haddock comment reflect what happens to the cost value. also fix a tpyo --- Crypto/KDF/BCrypt.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Crypto/KDF/BCrypt.hs b/Crypto/KDF/BCrypt.hs index 0356367..05b0a6b 100644 --- a/Crypto/KDF/BCrypt.hs +++ b/Crypto/KDF/BCrypt.hs @@ -1,7 +1,7 @@ -- | Password encoding and validation using bcrypt. -- --- Example usasge: +-- Example usage: -- -- >>> import Crypto.KDF.BCrypt (hashPassword, validatePassword) -- >>> import qualified Data.ByteString.Char8 as B @@ -78,6 +78,8 @@ hashPassword cost password = do return $ bcrypt cost (salt :: Bytes) password -- | Create a bcrypt hash for a password with a provided cost value and salt. +-- +-- Cost value under 4 will be automatically adjusted back to 10 for safety reason. bcrypt :: (ByteArray salt, ByteArray password, ByteArray output) => Int -- ^ The cost parameter. Should be between 4 and 31 (inclusive).