Documentation ¶
Overview ¶
Source code taken from: https://stackoverflow.com/a/22892986
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func Contains(s []string, str string) bool
- func GenerateJWTTokenPair(hmacSecret []byte, sessionUuid string, d time.Duration) (string, string, error)
- func HashPassword(password string) (string, error)
- func NewRandomString(n int) string
- func ProcessBearerToken(hmacSecret []byte, tokenString string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
Function checks the plaintext string and hash string and returns either true or false depending.
func GenerateJWTTokenPair ¶
func GenerateJWTTokenPair(hmacSecret []byte, sessionUuid string, d time.Duration) (string, string, error)
Generate the `access token` and `refresh token` for the secret key.
func HashPassword ¶
Function takes the plaintext string and returns a hash string.
func NewRandomString ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.