Documentation ¶
Index ¶
- Variables
- func ArrayContainsString(arr *[]string, str string) bool
- func ArrayContainsUint64(arr *[]uint64, value uint64) bool
- func CheckPasswordSafety(s string, minLengh, maxLenght uint8) bool
- func CheckPasswordSecurity(s string, minlength, maxlengh int) bool
- func ComparePasswords(hashedPwd string, plainPwd string) bool
- func FindSubstringOcurrences(text, substring string) ([]int, error)
- func GenerateNumbersRandomString(n int) (*string, error)
- func GenerateRamdomString(n int, source string) (*string, error)
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(n int) (*string, error)
- func GenerateRandomStringURLSafe(n int) (string, error)
- func GenerateUpperCaseAndNumbersRandomString(n int) (*string, error)
- func HashAndSalt(pwd *[]byte) string
- func IsEmailValid(e string) bool
- func IsNil(i interface{}) bool
- func RemoveDiacritics(s string) *string
- func ToJson(n interface{}) (string, bool)
Constants ¶
This section is empty.
Variables ¶
var (
NumbersRegex = regexp.MustCompile("^[0-9]+$")
)
Functions ¶
func ArrayContainsString ¶
Checks if an string array contains a given string and returns true if it is present
func ArrayContainsUint64 ¶
func CheckPasswordSafety ¶
func CheckPasswordSecurity ¶ added in v0.1.3
Check the password security: They have to be at least on upper, one lower, a number and a spacial charcter
func ComparePasswords ¶ added in v0.1.3
func FindSubstringOcurrences ¶
func GenerateNumbersRandomString ¶ added in v0.1.3
GenerateNumbersRandomString returns a securely generated random string containing n numbers from 0 to 9.
It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRamdomString ¶ added in v0.1.3
GenerateRamdomString returns a securely generated random string containing n characters from source.
It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomBytes ¶ added in v0.1.3
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomString ¶ added in v0.1.3
GenerateRandomString returns a securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomStringURLSafe ¶ added in v0.1.3
GenerateRandomStringURLSafe returns a URL-safe, base64 encoded securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateUpperCaseAndNumbersRandomString ¶ added in v0.1.3
GenerateUpperCaseAndNumbersRandomString returns a securely generated random string containing n uppercase letters (!O) and numbers (!0).
It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func HashAndSalt ¶ added in v0.1.3
func RemoveDiacritics ¶
Types ¶
This section is empty.