This commit is contained in:
zhaoyupeng
2025-06-12 14:12:16 +08:00
commit 4eb256bc78
21 changed files with 1135 additions and 0 deletions

20
tool/password_test.go Normal file
View File

@ -0,0 +1,20 @@
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)
}