1 Star 0 Fork 1

taadis / webuy-sdk-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
client_test.go 592 Bytes
一键复制 编辑 原始数据 按行查看 历史
taadis 提交于 2020-09-25 15:02 . update client and test
package webuy
import "testing"
func TestMd5Sum(t *testing.T) {
actual := md5Sum("123456")
expect := "e10adc3949ba59abbe56e057f20f883e"
if actual != expect {
t.Fatalf("expect %s but actual %s", expect, actual)
}
}
func TestSign(t *testing.T) {
m := make(map[string]interface{})
s := Sign(m, "")
m["appId"] = "11111"
m["gmtRequest"] = "1560237616188"
m["randomStr"] = "e616d1a8-28ba-428a-8f35-b4f98adabb17"
m["supplierDockId"] = "33333"
s = Sign(m, "密钥")
expect := "D0CE9F42BAC4778C646FD339302B6A04"
if s != expect {
t.Fatalf("expect %s but actual %s", expect, s)
}
}
Go
1
https://gitee.com/taadis/webuy-sdk-go.git
git@gitee.com:taadis/webuy-sdk-go.git
taadis
webuy-sdk-go
webuy-sdk-go
master

搜索帮助