Exemplo n.º 1
0
//加密合作商密码
func PartnerSha1Pwd(usr, pwd string) string {
	return crypto.Sha1([]byte(ShaPwd(pwd, usr+":")))
}
Exemplo n.º 2
0
// 密码SHA1加密
func ShaPwd(pwd, offset string) string {
	return crypto.Sha1([]byte(strings.Join([]string{offset, pwd, "@h3f.net"}, "")))
}
Exemplo n.º 3
0
// 加密会员密码,因为可能会使用手机号码登陆,
// 所以密码不能依据用户名作为生成凭据
func MemberSha1Pwd(pwd string) string {
	return crypto.Sha1([]byte(ShaPwd(pwd, "")))
}