Documentation ¶
Index ¶
Constants ¶
View Source
const ( // D = "argon2d" I = "argon2i" ID = "argon2id" )
algorithms
Variables ¶
Functions ¶
func GenerateHash ¶
GenerateHash: Gets a password with optional hash options and returns the password hashed in argon2 with a random salt.
func GenerateHashNSalt ¶
GenerateHashNSalt: Gets password and salt in string and optional options and return the password hashed in argon2.
Return the error InvalidSalt if the salt is invalid
func VerifyHash ¶
VerifyHash: Gets password and encodedHash in string and compare if the password is equal to the encoded hash.
Return the InvalidHash error if the hash is not valid, or return a error from base64.RawStdEncoding.Strict().DecodeString.
Types ¶
Click to show internal directories.
Click to hide internal directories.