Comeonin.Tools
Module that provides various tools for the hashing algorithms.
Summary↑
dec_base64(string) | Decode using an adapted base64 alphabet (using |
dec_bcrypt64(string) | Decode using a base64 alphabet adapted for bcrypt |
enc_base64(data) | Encode using an adapted base64 alphabet (using |
enc_bcrypt64(data) | Encode using a base64 alphabet adapted for bcrypt |
secure_check(hash, stored) | Compares the two binaries in constant time to avoid timing attacks |
Functions
Decode using an adapted base64 alphabet (using .
instead of +
and with no padding).
Examples
iex> Comeonin.Tools.dec_base64 "c3BhbWFuZGVnZ3M"
"spamandeggs"
Decode using a base64 alphabet adapted for bcrypt.
Examples
iex> Comeonin.Tools.dec_bcrypt64 "a1/fZUDsXETlX1K"
"spamandeggs"
Encode using an adapted base64 alphabet (using .
instead of +
and with no padding).
Examples
iex> Comeonin.Tools.enc_base64 "spamandeggs"
"c3BhbWFuZGVnZ3M"
Encode using a base64 alphabet adapted for bcrypt.
Examples
iex> Comeonin.Tools.enc_bcrypt64 "spamandeggs"
"a1/fZUDsXETlX1K"
Compares the two binaries in constant time to avoid timing attacks.