21 lines
312 B
Go
21 lines
312 B
Go
package bcryptx_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"code.yun.ink/pkg/encryptx/bcryptx"
|
|
)
|
|
|
|
func TestDecryptBcrypt(t *testing.T) {
|
|
str, err := bcryptx.HashPassword("password")
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
t.Log(str)
|
|
if bcryptx.CheckPasswordHash("password", str) {
|
|
t.Log("ok")
|
|
} else {
|
|
t.Error("error")
|
|
}
|
|
}
|