crypto

package
v0.0.0-...-fd025f9 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGenerateToken = errors.New("failed to generate token")
	ErrInvalidToken  = errors.New("invalid token")
	ErrExpiredToken  = errors.New("token has expired")
	ErrInvalidLength = errors.New("invalid token length")
)

Functions

func HashPassword

func HashPassword(password string) (string, error)

HashPassword 使用 bcrypt 加密密码

func MapUUID

func MapUUID(uuid string, secret string) (string, error)

MapUUID 正向映射 UUID

func Simple

func Simple(content string, expiredAt time.Time) (string, error)

func UnmapUUID

func UnmapUUID(uuid string, secret string) (string, error)

UnmapUUID 反向映射 UUID

func ValidateSimple

func ValidateSimple(token string) (string, error)

func VerifyPassword

func VerifyPassword(dbPassword, password string) error

VerifyPassword 验证密码

Types

This section is empty.

Jump to

Keyboard shortcuts

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