示例#1
0
func testAuthProvider(user interface{}) (salt, hash []byte) {
	hash = []byte{}
	salt = []byte{}
	switch user.(type) {
	default:
		return
	case string:
		break
	}

	if user != "user" {
		return
	}
	ph := pbkdf2.HashPassword(test_password)
	hash = ph.Hash
	salt = ph.Salt
	return
}
示例#2
0
文件: auth.go 项目: kusuriya/webshell
// HashPass is provided to return a salt and string for a password.
func HashPass(password string) (salt, hash []byte) {
	ph := pbkdf2.HashPassword(password)
	hash = ph.Hash
	salt = ph.Salt
	return
}