lishwist/http/comparepword/main.go

20 lines
306 B
Go

package main
import (
"fmt"
"log"
"os"
"golang.org/x/crypto/bcrypt"
)
func main() {
passwordHash := []byte(os.Args[1])
password := []byte(os.Args[2])
err := bcrypt.CompareHashAndPassword(passwordHash, password)
if err != nil {
log.Fatalln("Failed to match: ", err)
}
fmt.Println("Match!")
}