示例#1
0
文件: digest.go 项目: peterh/comprod
func doHash(g *state.Game, thing, name string) string {
	digest := g.GetHash()
	io.WriteString(digest, thing)
	io.WriteString(digest, name)
	sum := digest.Sum(nil)
	return strings.TrimRight(base64.URLEncoding.EncodeToString(sum), "=")
}
示例#2
0
文件: digest.go 项目: peterh/comprod
func pwdHash(g *state.Game, name, password string) []byte {
	digest := g.GetHash()
	io.WriteString(digest, "password/")
	io.WriteString(digest, name)
	io.WriteString(digest, ":")
	io.WriteString(digest, password)
	return digest.Sum(nil)
}