From 8d92eb0b34b330eb334f493347a56d11c6512d43 Mon Sep 17 00:00:00 2001 From: selfrelease Date: Mon, 22 Jun 2026 18:48:13 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=88=A0=E9=99=A4=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=96=87=E4=BB=B6=20test=5Fpassword.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/test_password.go | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 server/test_password.go 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)) -}