Documentation ¶
Index ¶
- Constants
- func CheckPassword(password string) int
- func CheckUsername(username string) int
- func EncryptPassByBCR(password string) (string, error)
- func EncryptPassByMd5(password string) (string, error)
- func GenerateToken() string
- func Uint32() uint32
- func Uint32n(maxN uint32) uint32
- func VerifyPassByBCR(password string, hashedPassword string) bool
- func VerifyPassByMD5(password string, hashedPassword string) bool
- type RNG
Constants ¶
View Source
const (
PasswordCost = 12
)
Variables ¶
This section is empty.
Functions ¶
func EncryptPassByBCR ¶
EncryptPassByBCR BCR加密
func EncryptPassByMd5 ¶
EncryptPassByMd5 MD5加密
func Uint32 ¶
func Uint32() uint32
Uint32 returns pseudorandom uint32. It is safe calling this function from concurrent goroutines.
func Uint32n ¶
Uint32n returns pseudorandom uint32 in the range [0..maxN). It is safe calling this function from concurrent goroutines.
func VerifyPassByBCR ¶
VerifyPassByBCR BCR校验 password 用户输入密码 hashedPassword 数据库存储密码
func VerifyPassByMD5 ¶
VerifyPassByMD5 MD5校验 password 用户输入密码 hashedPassword 数据库存储密码
Types ¶
Click to show internal directories.
Click to hide internal directories.