mirror of https://github.com/synctv-org/synctv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
352 B
Go
23 lines
352 B
Go
package utils_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/synctv-org/synctv/utils"
|
|
)
|
|
|
|
func TestCrypto(t *testing.T) {
|
|
m := []byte("hello world")
|
|
key := []byte(utils.RandString(32))
|
|
m, err := utils.Crypto(m, key)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(string(m))
|
|
m, err = utils.Decrypto(m, key)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(string(m))
|
|
}
|