mirror of
https://gitee.com/willfree/tcpserver-client.git
synced 2026-06-18 09:20:27 +08:00
20 lines
380 B
Go
20 lines
380 B
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
// 测试加密解密
|
|
func TestEncryptAndDecrypt(t *testing.T) {
|
|
password:="1234567890"
|
|
enMsg:=encryptMsg("这是一个测试字符串",password)
|
|
fmt.Println("加密后字符串:"+enMsg)
|
|
deMsg:=decryptMsg(enMsg,password)
|
|
fmt.Println("解密后字符串:"+deMsg)
|
|
}
|
|
|
|
//// 测试解密
|
|
//func TestDecrypt(t *testing.T) {
|
|
//
|
|
//} |