Documentation ¶
Index ¶
- func Base64Decode(s string) (string, *errors.Error)
- func Base64Encode(s string) string
- func DecryptPassword(data, passphrase string) (string, *errors.Error)
- func EncryptPassword(data, passphrase string) (string, *errors.Error)
- func GetRandomPassword() string
- func VerifyPassword(password string) *errors.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
Base64Decode base64 decodes a string and returns it.
func Base64Encode ¶
Base64Encode base64 encodes a string and returns it.
func DecryptPassword ¶
DecryptPassword decrypted the data provided. If a passphrase was used to encrypt the password then the same passphrase needs to be passes to decrypt the password correctly.
func EncryptPassword ¶
EncryptPassword encrypts the data provided. The encryption can also be further secured using a passphrase.
func GetRandomPassword ¶
func GetRandomPassword() string
GetRandomPassword generates a random string of upper + lower case alphabets and digits which is 23 bits long and returns the string
func VerifyPassword ¶
VerifyPassword checks if the password is strong. The function checks if the password string is at least 8 character long, has an uppercase character, a lower case character, a number and a special character. If one of this condition fails the function returns an invalid password error.
Types ¶
This section is empty.