ASP MD5加密中文不能用,求解决

ad2532 2017-10-19 09:58:53
最近在调淘宝API,签名时发现MD5中文不能用,参数如果是英文或数字就能用,如果是中文就会报错,求解决
...全文
755 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ylabc 2018-09-03
  • 打赏
  • 举报
回复
引用 2 楼 cnbjx 的回复:
UTF-8编码的,支持中文。


Function MD5(text)
With CreateObject("MSXML.DOMDocument").createElement("a")
.dataType = "bin.hex"
.nodeTypedvalue = CreateObject("System.Security.Cryptography.MD5CryptoServiceProvider").ComputeHash_2(CreateObject("System.Text.UTF8Encoding").GetBytes_4(text))
MD5 = .text
End With
End Function

支持中文MD5加密,非常谢谢
cnbjx 2017-10-24
  • 打赏
  • 举报
回复
UTF-8编码的,支持中文。

Function MD5(text)
	With CreateObject("MSXML.DOMDocument").createElement("a")
		.dataType = "bin.hex"
		.nodeTypedvalue = CreateObject("System.Security.Cryptography.MD5CryptoServiceProvider").ComputeHash_2(CreateObject("System.Text.UTF8Encoding").GetBytes_4(text))
		MD5 = .text
	End With
End Function 
hookee 2017-10-20
  • 打赏
  • 举报
回复
如果只是自己验证的话,原文 用 Escpae()编码下再Md5。

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧