Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Password ¶
type Password struct { // hash过后的密码 Password string // 密码创建时间 CreateAt int64 // 密码更新时间 UpdateAt int64 // 密码需要被重置 NeedReset bool // 需要重置的原因 ResetReason string // 历史密码 History []string // 是否过期 IsExpired bool }
func NewHashedPassword ¶
NewHashedPassword 生产hash后的密码对象
func (*Password) CheckPassword ¶
CheckPassword 判断password 是否正确 输入的是明文: 123456 需要对比的Hash: $2a$10$ofPPqZ3m37Kp9ROK4ForAOXc5w6SsMKoJ9puCOgIO9yEFFknpYcsO
Click to show internal directories.
Click to hide internal directories.