util

package
v0.0.0-...-490d541 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(rawPwd, encryptedPwd, salt string) (bool, error)

验证密码

func HashPassword

func HashPassword(rawPwd string, salt string) (encryptedPwd string, err error)

密码加密:密码+Salt生成哈希序列

func MakeSalt

func MakeSalt() string

为密码生成Salt值 盐值允许异常情况下,使用默认值代替,为了保证密码安全,可以定期替换盐值

func NewPassword

func NewPassword(rawPwd string) (string, string, error)

创建新的密码(值对象) 如果创建过程中出错,会返回nil

func UpdatePassword

func UpdatePassword(rawPwd string, salt string) (encryptedPwd string, err error)

更新密码

Types

This section is empty.

Jump to

Keyboard shortcuts

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