Documentation ¶
Index ¶
- Constants
- Variables
- type CommonStrategy
- type Eval
- func (mpe *Eval) CommonVerify(pwd string) *CommonStrategy
- func (mpe *Eval) CoreVerify(pwd string) (*Response, error)
- func (mpe *Eval) PwnedVerify(pwd string) (bool, string, error)
- func (mpe *Eval) TopDictFilter(pwd string) (bool, string, error)
- func (mpe *Eval) ZxcvbnVerify(pwd string) (bool, string, error)
- type Response
- type VerifyItem
Constants ¶
View Source
const (
L33TMatcherName = "l33t"
)
Variables ¶
View Source
var ( ErrStringEmpty = errors.New("Empty password string error") ErrNonHTTPOk = errors.New("Non HTTP OK in API Call") )
View Source
var Top1000Pwd = `` /* 7408-byte string literal not displayed */
Functions ¶
This section is empty.
Types ¶
type CommonStrategy ¶
type CommonStrategy struct { IsDigit bool `json:"is_digit"` // 是否包含数字 IsUpper bool `json:"is_upper"` // 是否包含大写字母 IsLower bool `json:"is_lower"` // 是否包含小写字母 IsSpecial bool `json:"is_special"` // 是否包含特殊符号 PwdLength bool `json:"pwd_length"` }
常规策略
type Eval ¶
type Eval struct { HTTPClient *http.Client DictMap map[string]int Pwned bool //破解历史校验 Zxcvbn bool //zxcvbn校验 TopDict bool //常用字典校验 Digit bool //是否包含数字 Upper bool //是否包含大写字母 Lower bool //是否包含小写字母 Special bool //是否包含特殊符号 Length int //密码长度 }
func (*Eval) CommonVerify ¶
func (mpe *Eval) CommonVerify(pwd string) *CommonStrategy
func (*Eval) PwnedVerify ¶
PwnedVerify 原说明如下 In order to protect the value of the source password being searched for, Pwned Passwords also implements a k-Anonymity model that allows a password to be searched for by partial hash. This allows the first 5 characters of a SHA-1 password hash (not case-sensitive) to be passed to the API (testable by clicking here): GET https://api.pwnedpasswords.com/range/{first 5 hash chars}
type Response ¶
type Response struct { VerifyItem *VerifyItem `json:"verify_item"` Message string `json:"message"` Status bool `json:"status"` }
type VerifyItem ¶
type VerifyItem struct { Zxcv bool `json:"zxcv"` Pwned bool `json:"pwned"` TopDict bool `json:"top_dict"` CommonStrategy CommonStrategy `json:"common_strategy"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.