utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSecureSID added in v1.0.2

func GenerateSecureSID() (string, error)

GenerateSecureSID returns a session ID in the format: "sid_<64-character-hex-string>" Example: "sid_a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456"

func HashPassword

func HashPassword(password string, cost int) (string, error)

HashPassword generates a bcrypt hash of the password with the given cost

func IsValidPassword

func IsValidPassword(password string) bool

IsValidPassword checks if password meets security requirements

func ParseSameSite

func ParseSameSite(sameSite string) http.SameSite

ParseSameSite converts string to http.SameSite Used by both JWT middleware and session configuration

func VerifyPassword

func VerifyPassword(hashedPassword, password string) error

VerifyPassword compares a hashed password with a plaintext password

Types

This section is empty.

Jump to

Keyboard shortcuts

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