20 lines
444 B
Go
Raw Normal View History

package main
import (
"fmt"
"golang.org/x/crypto/bcrypt"
)
func main() {
hash := "$2a$10$S5XPWRXUnexAt9KJw2CefeHMa6aude7j5dm5qgWM1YMQAAwRgsGXa"
passwords := []string{"admin123", "muyu2026", "admin", "123456", "password", "Aa123456"}
for _, p := range passwords {
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(p))
if err == nil {
fmt.Printf("MATCH: %s\n", p)
} else {
fmt.Printf("%-12s → %v\n", p, err)
}
}
}