utils

package
v0.0.0-...-d76bcad Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMapHaveKeys

func CheckMapHaveKeys[C comparable, A any](m map[C]A, keys ...C) error

func CompareHashAndPassword

func CompareHashAndPassword(hashedPassword, password, salt string) error

func ConvertMapStringStringToMapStringAny

func ConvertMapStringStringToMapStringAny(m map[string]string) (n map[string]any)

func ConvertMapToString

func ConvertMapToString(m map[string]string) (string, error)

func ConvertStringToMap

func ConvertStringToMap(s string) (map[string]string, error)

func GenerateRandomSalt

func GenerateRandomSalt() (string, error)

func GetIPAddress

func GetIPAddress(r *http.Request) string

returns "" if ip not found

func GetUserAgent

func GetUserAgent(r *http.Request) string

func HashPasswordWithSalt

func HashPasswordWithSalt(password string, salt string, bcryptCost int) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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