Documentation ¶
Index ¶
Constants ¶
View Source
const ( Argon2Time = 4 // Argon2 参数,迭代次数 Argon2Memory = 64 * 1024 // Argon2 参数,内存大小(KB) Argon2Threads = 1 // Argon2 参数,线程数 Argon2KeyLen = 32 // Argon2 参数,生成的密钥长度 SaltSize = 16 // 盐值长度 SplitChar = ":" )
Argon2 参数
Variables ¶
View Source
var ( ErrGenerateSaltFailed = errors.New("failed to generate salt") ErrDecodeSaltFailed = errors.New("failed to decode salt") ErrSplitHashInvalid = errors.New("invalid hash format") ErrDecodeHashFailed = errors.New("failed to decode hash") )
定义常见错误消息
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") ErrCiphertextTooShort = errors.New("ciphertext too short") ErrInvalidSHA256Length = errors.New("SHA256 hash must be 64 characters long") ErrInvalidSHA256Format = errors.New("SHA256 hash must be a valid hexadecimal string") )
定义常见错误消息
Functions ¶
func ValidateSHA256 ¶ added in v1.8.69
ValidateSHA256 验证字符串是否为 64 位长度的 SHA-256 哈希值
func ValidateSixNumberAsPwd ¶ added in v1.8.68
ValidateSixNumberAsPwd 验证指定长度的纯数字字符串密码
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.