rano/util/crypto/hash_test.go
Ankit Patial 26a00c9f7c working on auth.
mailer, basic setup with html template and a dev treansport
2024-11-15 21:42:15 +05:30

23 lines
365 B
Go

package crypto
import "testing"
func TestPasswordHash(t *testing.T) {
pwd := "MY Bingo pwd"
hash, salt, err := PasswordHash(pwd)
if err != nil {
t.Error(err)
return
}
if hash == "" || salt == "" {
t.Error("either hash or password is empty")
return
}
if !ComparePasswordHash(pwd, string(hash), string(salt)) {
t.Error("supposed to match")
}
}