refactor(utils): 修复密码哈希比较逻辑错误 feat(user): 新增按状态筛选优惠券接口 docs: 添加虚拟发货与任务中心相关文档 fix(wechat): 修正Code2Session上下文传递问题 test: 补充订单折扣与积分转换测试用例 build: 更新配置文件与构建脚本 style: 清理多余的空行与注释
26 lines
641 B
Go
26 lines
641 B
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestGenerateAdminHashedPassword(t *testing.T) {
|
|
chatMd5 := MD5("chat2025")
|
|
chatHash, chatErr := GenerateAdminHashedPassword(chatMd5)
|
|
t.Log("chat2025 MD5:", chatMd5, "Hash:", chatHash, "Err:", chatErr)
|
|
|
|
pwdMd5 := MD5("123456")
|
|
pwdHash, pwdErr := GenerateAdminHashedPassword(pwdMd5)
|
|
t.Log("123456 MD5:", pwdMd5, "Hash:", pwdHash, "Err:", pwdErr)
|
|
}
|
|
|
|
func TestXorEncrypt(t *testing.T) {
|
|
t.Log(XorEncrypt(fmt.Sprintf("%s%d", "13800000001", time.Now().Local().Unix()), "999999"))
|
|
}
|
|
|
|
func TestXorDecrypt(t *testing.T) {
|
|
t.Log(XorDecrypt("CAoBCQkJCQkJCQgIDgwKAQwKCg8B", "999999"))
|
|
}
|