Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encrypt ¶
Encrypt encrypts data using 256-bit AES-GCM. Needs a 256 bit key (32 characters) or it fails Returned string is empty on error
func Hash ¶
Hash generates a hash of data using HMAC-SHA-512/256 and adds the description text as HMAC "key" to get different hashes for different purposes. This function is NOT SECURE ENOUGH for securely hashing normal user-entered passwords, use HashPassword instead!
func Random ¶
Random generates a NOT SECURE! random string of defined length The result is NOT SECURE but fast because it uses the time as seed taken from https://goo.gl/9GBmNN
func RandomSecure ¶
RandomSecure returns a SECURELY generated random string randType can be:
- "alpha" for range A-Z a-z
- "number" for range 0-9, returns string number with leading 0s
- "pin" for range 1-9 A-Z without O, I letters
- any other value for A-Z a-z 0-9
It will panic in the super rare case of an issue to avoid any cascading security issues orients on https://goo.gl/kK987i and https://goo.gl/NRrS7y
Types ¶
This section is empty.