authable v0.10.0 Authable.Utils.Crypt
Crypt utilities
Link to this section Summary
Functions
Generates a random string
Compares string with Bcrypted version of the string
Generate a salt from given string
Link to this section Functions
Link to this function
generate_token()
Generates a random string
Examples
Authable.Utils.Crypt.generate_token
# "ve7LXBsGqsvsXXjiFS1PVQ"
Link to this function
match_password(password, crypted_password)
Compares string with Bcrypted version of the string.
Returns true if mathes, otherwise false
Examples
Authable.Utils.Crypt.match_password("12345678",
"$2b$12$wHkoEnYQ03mWH1CsByPB4ek4xu7QXIFYl5gAC6b8zYs3aj/9DNv3u"
)
Link to this function
salt_password(password)
Generate a salt from given string.
Returns crypted string
Examples
Authable.Utils.Crypt.salt_password("12345678")
# "$2b$12$wHkoEnYQ03mWH1CsByPB4ek4xu7QXIFYl5gAC6b8zYs3aj/9DNv3u"