Documentation ¶
Overview ¶
Package password
@author: xwc1125
Package password ¶
@author: xwc1125
Index ¶
- Variables
- func CheckPassword(hashPwd, plaintextPwd string) bool
- func EncryptKey(key Key, auth string) ([]byte, error)
- func GeneratePassword(plaintextPwd string) (hash []byte, err error)
- func GeneratePasswordByScrypt(password string, salt string) (hash string, err error)
- func GenerateSalt() (salt string, err error)
- func HashCode(key string) int
- type Key
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BcryptCost = bcrypt.DefaultCost Base = "www.xwc1125.com" BaseKeyLen = 16 )
Functions ¶
func GeneratePassword ¶
GeneratePassword 生成密码 plaintextPwd 明文密码 对密码进行加密,获得密码hash
func GeneratePasswordByScrypt ¶
GeneratePasswordByScrypt 生成passHash
Types ¶
Click to show internal directories.
Click to hide internal directories.