Documentation ¶
Index ¶
- Variables
- func Base64Decode(encodedData string) (string, error)
- func Base64Encode(data string) string
- func ComparePasswordAndHash(password, encodedHash string) (match bool, err error)
- func DecryptStructFields(data interface{}) error
- func EncryptStructFields(data interface{}) error
- func GenerateNewJwtToken(id uint64, credentials []string, expiresAt time.Time) (string, error)
- func GenerateRandomBase64String() (string, error)
- func HashPassword(password string) (string, error)
- func RandStringRunes(n int) (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") )
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func ComparePasswordAndHash ¶
Check if the password is match the hashed password
func DecryptStructFields ¶
func DecryptStructFields(data interface{}) error
func EncryptStructFields ¶
func EncryptStructFields(data interface{}) error
func GenerateNewJwtToken ¶
Generate new jwt token with credentials
func GenerateRandomBase64String ¶
Generate 32 long random base64 string
func RandStringRunes ¶
Generate random string this can provide 88^n possible
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.