encrypt

package
v0.0.0-...-b9d6e19 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(id uint32, username, uid string) (string, error)

func Md5String

func Md5String(str string) string

func PasswdEncrypt

func PasswdEncrypt(passwd string) string

PasswdEncrypt 对密码进行加盐加密

func Salt

func Salt() string

Salt 生成随机盐值

func VerifyPasswd

func VerifyPasswd(passwd, encrypted string) bool

VerifyPasswd 验证密码

func VerifyToken

func VerifyToken(token string) (string, string, uint32, error)

Types

type Claim

type Claim struct {
	Username string
	Id       uint32
	Uid      string
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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