[bcrypt] make the haddock comment reflect what happens to the cost value.
also fix a tpyo
This commit is contained in:
parent
e5748d5edf
commit
f362d50d46
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
-- | Password encoding and validation using bcrypt.
|
-- | Password encoding and validation using bcrypt.
|
||||||
--
|
--
|
||||||
-- Example usasge:
|
-- Example usage:
|
||||||
--
|
--
|
||||||
-- >>> import Crypto.KDF.BCrypt (hashPassword, validatePassword)
|
-- >>> import Crypto.KDF.BCrypt (hashPassword, validatePassword)
|
||||||
-- >>> import qualified Data.ByteString.Char8 as B
|
-- >>> import qualified Data.ByteString.Char8 as B
|
||||||
@ -78,6 +78,8 @@ hashPassword cost password = do
|
|||||||
return $ bcrypt cost (salt :: Bytes) password
|
return $ bcrypt cost (salt :: Bytes) password
|
||||||
|
|
||||||
-- | Create a bcrypt hash for a password with a provided cost value and salt.
|
-- | 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)
|
bcrypt :: (ByteArray salt, ByteArray password, ByteArray output)
|
||||||
=> Int
|
=> Int
|
||||||
-- ^ The cost parameter. Should be between 4 and 31 (inclusive).
|
-- ^ The cost parameter. Should be between 4 and 31 (inclusive).
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user