View Source bcrypt_nif (bcrypt v1.2.1)
The wrapper around the OpenBSD Blowfish password hashing algorithm, as described in: "A Future-Adaptable Password Scheme" by Niels Provos and David Mazieres.
Link to this section Summary
Functions
Create a context which hashes passwords in a separate thread.
Generate a random text salt for use with hashpw/3. LogRounds defines the complexity of the hashing, increasing the cost as 2^log_rounds.
Hash the specified password and the salt using the OpenBSD Blowfish password hashing algorithm. Returns the hashed password.
Link to this section Functions
-spec create_ctx() -> Context when Context :: term().
-spec gen_salt(LogRounds) -> Result when LogRounds :: integer(), Result :: [byte()].
-spec hashpw(Ctx, Ref, Pid, Password, Salt) -> Result
when
Ctx :: term(),
Ref :: reference(),
Pid :: pid(),
Password :: [byte()],
Salt :: [byte()],
Result :: ok.