- dingding callback

This commit is contained in:
gazebo
2019-03-09 08:10:04 +08:00
parent 9bd3b3f086
commit 803240fc9f
6 changed files with 160 additions and 26 deletions

21
utils/utils_crypt_test.go Normal file
View File

@@ -0,0 +1,21 @@
package utils
import (
"testing"
)
func TestCrypt(t *testing.T) {
aesKey := []byte("123456789012345678901234567890ab")
msg := "hellasfsafsdsads"
encryptedMsg, err := AESCBCEncpryt([]byte(msg), aesKey, aesKey[:16])
if err != nil {
t.Fatal(err)
}
decryptedMsg, err := AESCBCDecpryt(encryptedMsg, aesKey, aesKey[:16])
if err != nil {
t.Fatal(err)
}
if msg != string(decryptedMsg) {
t.Fatal("result is wrong")
}
}