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 ReverseString(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 ¶
Check the password security: They have to be at least on upper, one lower, a number and a spacial charcter
func ComparePasswords ¶
func FindSubstringOcurrences ¶
func GenerateNumbersRandomString ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
func RemoveDiacritics ¶
func ReverseString ¶ added in v0.1.1
ReverseString reverses a string
Types ¶
This section is empty.