View Source bcrypt (bcrypt v2.0.0)
The OpenBSD Blowfish password hashing algorithm wrapper module.
Summary
Functions
Returns a random string data.
Generate a random string data.
Generate a random salt with an explicit version. Use '2y' for PHP; gen_salt/0 and gen_salt/1 default to '2b'.
Make hash string based on Password and Salt.
Is at least one bcrypt worker currently available for work?
Get environment setting of hash generation.
Starts Applicationbcrypt. See also:application:start/1.
Stops Applicationbcrypt. See also:application:stop/1.
Types
-type mechanism() :: nif | port.
-type pwerr() ::
invalid_salt | invalid_salt_length | invalid_rounds | invalid_password |
invalid_password_length.
-type rounds() :: 4..31.
-type version() :: '2b' | '2y'.
Functions
-spec gen_salt() -> Result when Result :: {ok, Salt}, Salt :: [byte()].
Returns a random string data.
Generate a random string data.
Generate a random salt with an explicit version. Use '2y' for PHP; gen_salt/0 and gen_salt/1 default to '2b'.
-spec hashpw(Password, Salt) -> Result when Password :: [byte()] | binary(), Salt :: [byte()] | binary(), Result :: {ok, Hash} | {error, ErrorDescription}, Hash :: [byte()], ErrorDescription :: pwerr().
Make hash string based on Password and Salt.
-spec is_worker_available() -> Result when Result :: boolean().
Is at least one bcrypt worker currently available for work?
-spec mechanism() -> mechanism().
Get environment setting of hash generation.
Starts Applicationbcrypt. See also:application:start/1.
Stops Applicationbcrypt. See also:application:stop/1.