Documentation ¶
Index ¶
- Variables
- func CompareHashAndPassword(encodedHash, password string) error
- func CreateJWT(key []byte, claims jwt.MapClaims) (string, error)
- func Decrypt(key, data []byte) (string, error)
- func Encrypt(key, data []byte) ([]byte, error)
- func HashPassword(password string, parameter Argon2IDParameter) (string, error)
- func ValidateJWT(key []byte, signedToken string) (jwt.MapClaims, error)
- type Argon2IDParameter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RegexEncodedHash = regexp.MustCompile(`\$argon2id\$v=(\d+)\$m=(\d+),t=(\d+),p=(\d+)\$([A-Za-z0-9+/=]+)\$([A-Za-z0-9+/=]+)`) ErrorInvalidHashEncoding = errors.New("hash does not have a valid encoding") ErrorInvalidArgon2Version = errors.New("invalid argon2 version") )
View Source
var ErrorHashAndPasswordDoNotMatch = errors.New("hash and password do not match")
Functions ¶
func CompareHashAndPassword ¶
func HashPassword ¶
func HashPassword(password string, parameter Argon2IDParameter) (string, error)
func ValidateJWT ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.