password

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKey = key
	DefaultIv  = "1234567890123456"
)

Variables

View Source
var ErrValidatePassword = perrors.ErrorInvalidParams("密码错误")

Functions

func DecryptPassword

func DecryptPassword(password, salt string) (str string, err error)

DecryptPassword 解密密码

func EncryptPassword

func EncryptPassword(password, salt string) (str string, err error)

EncryptPassword 加密密码

func GeneratePassword

func GeneratePassword(password, salt string) (string, error)

GeneratePassword 生成密码

func GenerateSalt

func GenerateSalt() string

GenerateSalt 生成盐

func ValidatePassword

func ValidatePassword(p1, dePass, salt string) bool

ValidatePassword 验证密码

func ValidatePasswordErr

func ValidatePasswordErr(p1, dePass, salt string) error

ValidatePasswordErr 验证密码

Types

This section is empty.

Jump to

Keyboard shortcuts

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