Documentation
¶
Index ¶
- Variables
- func Base64Decode(encodedData string) (string, error)
- func Base64Encode(data string) string
- func ComparePasswordAndHash(password, encodedHash string) (match bool, err error)
- func GenerateID() uint64
- func GenerateNewJwtToken(id uint64, credentials []string, expiresAt time.Time) (string, error)
- func GenerateRandomBase64String(bits int) (string, error)
- func HashPassword(password string) (string, error)
- func ParseAndValidateJWT(tokenString string) (jwt.MapClaims, error)
- func RandStringRunes(n int, urlSafe bool) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidHash = errors.New("the encoded hash is not in the correct format") ErrIncompatibleVersion = errors.New("incompatible version of argon2") )
View Source
var JwtSecretKey = ""
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func ComparePasswordAndHash ¶
Check if the password is match the hashed password
func GenerateNewJwtToken ¶
Generate new jwt token with credentials
func GenerateRandomBase64String ¶
Generate random base64 string
func ParseAndValidateJWT ¶
ParseAndValidateJWT parses and validates the JWT, returning the claims and any error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.