Comeonin v5.2.0 Comeonin.PasswordHash behaviour View Source
Defines a behaviour for password hashing functions.
Link to this section Summary
Callbacks
Generates a random salt and then hashes the password.
Checks the password by comparing it with a stored hash.
Link to this section Types
Link to this type
opts()
View Source
opts()
View Source
opts() :: keyword()
opts() :: keyword()
Link to this type
password()
View Source
password()
View Source
password() :: binary()
password() :: binary()
Link to this type
password_hash()
View Source
password_hash()
View Source
password_hash() :: binary()
password_hash() :: binary()
Link to this section Callbacks
Link to this callback
hash_pwd_salt(password, opts)
View Source
hash_pwd_salt(password, opts)
View Source
hash_pwd_salt(password(), opts()) :: password_hash()
hash_pwd_salt(password(), opts()) :: password_hash()
Generates a random salt and then hashes the password.
Link to this callback
verify_pass(password, password_hash)
View Source
verify_pass(password, password_hash)
View Source
verify_pass(password(), password_hash()) :: boolean()
verify_pass(password(), password_hash()) :: boolean()
Checks the password by comparing it with a stored hash.
Please note that the first argument to verify_pass
should be the
password, and the second argument should be the password hash.