View Source Bcrypt.Base (bcrypt_elixir v3.0.0)

Base module for the Bcrypt password hashing library.

Link to this section Summary

Functions

Verify the password by comparing it with the stored hash.

Generate a salt for use with the hash_password function.

Generate a salt for use with Bcrypt.

Hash the password and salt with the Bcrypt hashing algorithm.

Hash a password using Bcrypt.

Link to this section Functions

Link to this function

checkpass_nif(password, stored_hash)

View Source

Verify the password by comparing it with the stored hash.

Link to this function

gen_salt(log_rounds \\ 12, legacy \\ false)

View Source

Generate a salt for use with the hash_password function.

The :log_rounds parameter determines the computational complexity of the generation of the password hash. Its default is 12, the minimum is 4, and the maximum is 31.

The :legacy option is for generating salts with the old $2a$ prefix. Only use this option if you need to generate hashes that are then checked by older libraries.

Link to this function

gensalt_nif(random, log_rounds, minor)

View Source

Generate a salt for use with Bcrypt.

Link to this function

hash_nif(password, salt)

View Source

Hash the password and salt with the Bcrypt hashing algorithm.

Link to this function

hash_password(password, salt)

View Source

Hash a password using Bcrypt.