helpers

package
v0.0.0-...-fe1601c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

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

func GenerateRandomString(n int) (string, error)

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

func GenerateRandomStringURLSafe(n int) (string, error)

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 HashPassword

func HashPassword(password string) (string, error)

func InArray

func InArray(val interface{}, array interface{}) (exists bool, index int)

func IsEmail

func IsEmail(s string) bool

func Sha256

func Sha256(s string) string

func StrCapRandom

func StrCapRandom(length int) string

func StrNumRandom

func StrNumRandom(length int) string

func StrRandom

func StrRandom(length int) string

func StrSlug

func StrSlug(s string) string

func StrSlugRandom

func StrSlugRandom(s string) string

func Truncate

func Truncate(s string, length int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL