hash test

This commit is contained in:
valitovgaziz
2024-08-15 08:25:49 +05:00
parent e135055dab
commit 9da6db076b
3 changed files with 29 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
t:
@go test ./... -v
tc:
go
@DEFAULT_GOAL=t
+16
View File
@@ -0,0 +1,16 @@
package auth
import (
"testing"
"golang.org/x/crypto/bcrypt"
)
func Test_hashPass(t *testing.T) {
password := "some hard password"
hash, _ := hashPassword(password)
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))
if err != nil {
t.Errorf("Falis by: %s", err)
}
}