ushare/internal/pkg/tool/password_test.go
loveuer 93c4339039
Some checks failed
/ build and run u-api (push) Failing after 8s
/ clean (push) Successful in 0s
init: 0.1.2
feat: login page && auth required
todo: file dir cleanup
2025-05-09 17:49:12 +08:00

21 lines
375 B
Go

package tool
import "testing"
func TestEncPassword(t *testing.T) {
password := "123456"
result := EncryptPassword(password, RandomString(8), 50000)
t.Logf("sum => %s", result)
}
func TestPassword(t *testing.T) {
p := "wahaha@123"
p = NewPassword(p)
t.Logf("password => %s", p)
result := ComparePassword("wahaha@123", p)
t.Logf("compare result => %v", result)
}