Documentation ¶
Overview ¶
Package crypto provides support for encrypting passwords and generating tokens for authentication support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BcryptPassword ¶
BcryptPassword uses bcrypt to hash password.
func CompareBcryptHashPassword ¶
CompareBcryptHashPassword compares pwd hash to original hash.
func GenerateToken ¶
func GenerateToken(entity SecureEntity) ([]byte, error)
GenerateToken returns a hash for SecureEntity interface.
func IsTokenValid ¶
func IsTokenValid(entity SecureEntity, hash string) error
IsTokenValid checks whether a hash is valid.
Types ¶
Click to show internal directories.
Click to hide internal directories.