utils

package
v1.3.37 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelToSnake

func CamelToSnake(s string) string

func CheckPasswordHash

func CheckPasswordHash(password, hashedPassword string) bool

func Contains

func Contains(slice []string, item string) bool

func FileChecksum

func FileChecksum(filepath string) (string, error)

func FileExists

func FileExists(filepath string) bool

func FormatDate

func FormatDate(input string) string

Ensure that single-digit day and month are zero-padded

func GenerateID

func GenerateID(length ...int) string

func GenerateJWT added in v1.3.29

func GenerateJWT(claims jwt.Claims) (string, error)

func GenerateOTP

func GenerateOTP() string

func GetNow

func GetNow() string

func HashPassword

func HashPassword(password string) (string, error)

func HumanReadableSize

func HumanReadableSize(size int64) string

func IsStrongPassword

func IsStrongPassword(password string) bool

func IsValidCreditCard

func IsValidCreditCard(card string) bool

func IsValidEmail

func IsValidEmail(email string) bool

IsValidEmail validates an email address using a regex pattern

func IsValidHexColor

func IsValidHexColor(color string) bool

func IsValidIPAddress

func IsValidIPAddress(ip string) bool

func IsValidURL

func IsValidURL(url string) bool

func ParseDate

func ParseDate(input string) (time.Time, error)

Function to parse date with single-digit handling

func SanitizeInput

func SanitizeInput(input string) string

func Slugify

func Slugify(text string) string

func URLEncode added in v1.1.12

func URLEncode(input string) string

func VerifyPhoneNumber

func VerifyPhoneNumber(phone string) bool

VerifyPhoneNumber checks if the phone number is in the format +917569236628

Types

This section is empty.

Jump to

Keyboard shortcuts

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