Documentation
¶
Index ¶
- func Decrypt(encrypted string, key []byte) (string, error)
- func Encrypt(plaintext string, key []byte) (string, error)
- func HMACSign(message, key string) string
- func HMACVerify(message, signature, key string) bool
- func RandomBase64(n int) string
- func RandomBytes(n int) ([]byte, error)
- func RandomHex(n int) string
- func SHA256Hash(data string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HMACVerify ¶
HMACVerify checks an HMAC-SHA256 signature (constant-time).
func RandomBase64 ¶
RandomBase64 returns a URL-safe base64-encoded random string.
func RandomBytes ¶
RandomBytes returns n cryptographically random bytes.
func SHA256Hash ¶
SHA256Hash returns the hex-encoded SHA-256 hash of data.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.