utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const DEFAULT_ALPHABET = "abcdefghijklmnopqrstuvwxyz1234567890"

Variables

This section is empty.

Functions

func ConvertByteSliceToHex

func ConvertByteSliceToHex(arr []byte) string

func GenerateRandomString

func GenerateRandomString(length int, alphabet string) string

func GenerateScryptHash

func GenerateScryptHash(s string) string

func GetBaseDomain

func GetBaseDomain(host string) string

func IsAllowedOrigin

func IsAllowedOrigin(origin, host string, allowedSubdomains []string) bool

func IsWithinExpiration

func IsWithinExpiration(expiration int64) bool

func ParseCookie

func ParseCookie(str string) map[string]string

func SerializeCookie

func SerializeCookie(name, val string, options *CookieAttributes) (string, error)

func ValidateScryptHash

func ValidateScryptHash(s, hash string) bool

Types

type CookieAttributes

type CookieAttributes struct {
	Domain   *string
	Encode   func(value string) string
	Expires  *time.Time
	MaxAge   *int
	Path     *string
	Priority *string
	SameSite *string
	HttpOnly bool
	Secure   bool
}

Jump to

Keyboard shortcuts

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