mirror of
https://github.com/SamyRai/turash.git
synced 2025-12-26 23:01:33 +00:00
19 lines
394 B
Go
19 lines
394 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"golang.org/x/crypto/bcrypt"
|
|
)
|
|
|
|
func main() {
|
|
storedHash := "$2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi"
|
|
password := "password"
|
|
|
|
err := bcrypt.CompareHashAndPassword([]byte(storedHash), []byte(password))
|
|
if err != nil {
|
|
fmt.Printf("Password verification failed: %v\n", err)
|
|
} else {
|
|
fmt.Println("Password verification successful")
|
|
}
|
|
}
|