pwd

package
v1.8.14 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSecPwdLength      = errors.New("password must be 6 digits")
	ErrInvalidSecPwdConsecutive = errors.New("password must not contain three consecutive identical digits")
	ErrInvalidSecPwdSequential  = errors.New("password must not contain three or more sequential digits")
)

定义常见错误消息

Functions

func GenerateSalt

func GenerateSalt(size int) ([]byte, error)

GenerateSalt 生成指定长度的盐值

func IsCorrectPassword

func IsCorrectPassword(password, hashedPassword string) bool

IsCorrectPassword 用于比较输入的密码和存储的散列值是否匹配

func NumberPwdValidate

func NumberPwdValidate(secPwd string, length int) error

NumberPwdValidate 验证指定长度的纯数字字符串密码

func SplitHash

func SplitHash(hash string) []string

SplitHash 分割存储的散列值和盐值

func StrToPwd

func StrToPwd(password string) (string, error)

StrToPwd 使用 argon2id 算法生成密码的散列值

Types

This section is empty.

Jump to

Keyboard shortcuts

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