diff --git a/server/test_password.go b/server/test_password.go deleted file mode 100644 index 9d39ec5..0000000 --- a/server/test_password.go +++ /dev/null @@ -1,22 +0,0 @@ -package main - -import ( - "fmt" - "golang.org/x/crypto/bcrypt" -) - -func main() { - password := "admin123" - hash := "$2a$10$xx3wEU5GY6FbKd4Y7.r7SeyC2872l/bJwsrCx2KMdfWQ.tOHJ7Y4O" - - err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password)) - if err == nil { - fmt.Println("✅ 密码匹配成功") - } else { - fmt.Printf("❌ 密码不匹配: %v\n", err) - } - - // 生成新的哈希测试 - newHash, _ := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) - fmt.Printf("新生成的哈希: %s\n", string(newHash)) -}