Documentation ¶
Index ¶
- Variables
- func Base62Hash(text string) string
- func DecryptAES(encryptedData []byte, key []byte) ([]byte, error)
- func EncryptAES(data []byte, key []byte) ([]byte, error)
- func GenerateAccessAndRefreshTokens(userId string, accessTokenExpiry time.Duration, ...) (string, string)
- func GenerateJWT(userId string, expiresIn time.Duration, secret string) (string, error)
- func RandomString() string
- func VerifyJWT(token string, secret string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTokenExpired = errors.New("token expired") ErrMalformedToken = errors.New("malformed token") )
Functions ¶
func Base62Hash ¶
func DecryptAES ¶
Decrypts data using AES algorithm. The key should be same key that was used to encrypt the data.
func EncryptAES ¶
Encrypts data using AES algorithm. The key should be 16, 24, or 32 for 128, 192, or 256 bit encryption respectively.
func GenerateJWT ¶
func RandomString ¶
func RandomString() string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.