add gcrc test
@@ -15,7 +15,7 @@ import (
"github.com/gogf/gf/g/test/gtest"
)
-func TestEncrypt(t *testing.T) {
+func TestEncryptString(t *testing.T) {
gtest.Case(t, func() {
s := "pibigstar"
result := 693191136
@@ -25,3 +25,14 @@ func TestEncrypt(t *testing.T) {
gtest.AssertEQ(int(encrypt2), result)
})
}
+
+func TestEncrypt(t *testing.T) {
+ gtest.Case(t, func() {
+ s := "pibigstar"
+ result := 693191136
+ encrypt1 := gcrc32.Encrypt(s)
+ encrypt2 := gcrc32.Encrypt([]byte(s))
+ gtest.AssertEQ(int(encrypt1), result)
+ gtest.AssertEQ(int(encrypt2), result)
+ })
+}
