优化代码

This commit is contained in:
刘祥超
2024-05-11 09:23:54 +08:00
parent f5596b4f0c
commit 777bbdf50b
116 changed files with 175 additions and 161 deletions

View File

@@ -0,0 +1,26 @@
package encrypt_test
import (
"github.com/TeaOSLab/EdgeNode/internal/utils/encrypt"
"testing"
)
func TestRawMethod_Encrypt(t *testing.T) {
method, err := encrypt.NewMethodInstance("raw", "abc", "123")
if err != nil {
t.Fatal(err)
}
var src = []byte("Hello, World")
dst, err := method.Encrypt(src)
if err != nil {
t.Fatal(err)
}
dst = dst[:len(src)]
t.Log("dst:", string(dst))
src, err = method.Decrypt(dst)
if err != nil {
t.Fatal(err)
}
t.Log("src:", string(src))
}