You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
516 B

package encoding
import (
"testing"
"github.com/smartystreets/goconvey/convey"
)
var c = &EncryptConfig{Key: "bilibili_key_GYl", IV: "biliBiliIv123456"}
const (
plat = "13291831554"
enc = "dWLVOucFkBBmmXmTm6so5A=="
)
func TestEncrypt(t *testing.T) {
convey.Convey("Encrypt", t, func() {
s, _ := Encrypt(plat, c)
convey.So(s, convey.ShouldEqual, enc)
})
}
func TestDecrypt(t *testing.T) {
convey.Convey("Decrypt", t, func() {
s, _ := Decrypt(enc, c)
convey.So(s, convey.ShouldEqual, plat)
})
}