使用.net库进行MD5加密非常简便,直接上代码,支持中英文。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
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("中国")%>