Documentation ¶
Index ¶
- func Contains(slice []string, value string) bool
- func CreateHash(toHash []byte) string
- func Decrypt(ciphertext []byte, key []byte) (plaintext []byte, err error)
- func Encrypt(plaintext []byte, key []byte) (ciphertext []byte, err error)
- func NewEncryptionKey() []byte
- func ValidateHostName(name string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
Contains will check a given []string to see if a value is inside of it, and returns true if so and false if not.
func CreateHash ¶
CreateHash will return a hashed string of a given string
func Decrypt ¶
Decrypt decrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Expects input form nonce|ciphertext|tag where '|' indicates concatenation.
func Encrypt ¶
Encrypt encrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Output takes the form nonce|ciphertext|tag where '|' indicates concatenation.
func NewEncryptionKey ¶
func NewEncryptionKey() []byte
NewEncryptionKey generates a random 256-bit key for Encrypt() and Decrypt().
func ValidateHostName ¶
ValidateHostName will use regex to determine if the given URL or IP address is valid.
Types ¶
This section is empty.