View Source bcrypt (bcrypt v1.2.1)

The OpenBSD Blowfish password hashing algorithm wrapper module.

Link to this section Summary

Functions

Returns a random string data.
Generate a random string data.
Make hash string based on Password and Salt.
Get environment setting of hash generation.
Starts Applicationbcrypt. See also:application:start/1.
Stops Applicationbcrypt. See also:application:stop/1.

Link to this section Types

-type mechanism() :: nif | port.
-type pwerr() :: invalid_salt | invalid_salt_length | invalid_rounds.
-type rounds() :: 4..31.

Link to this section Functions

-spec gen_salt() -> Result when Result :: {ok, Salt}, Salt :: [byte()].
Returns a random string data.
-spec gen_salt(Rounds) -> Result when Rounds :: rounds(), Result :: {ok, Salt}, Salt :: [byte()].
Generate a random string data.
-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 mechanism() -> mechanism().
Get environment setting of hash generation.
Starts Applicationbcrypt. See also:application:start/1.
Stops Applicationbcrypt. See also:application:stop/1.