asp加密解密函数

程序代码 程序代码
<%
'加密
function encode(x)
for i=1 to len(x)
TempNum=hex(asc(mid(x,i,1)))
if len(TempNum)=4 then
encode=encode & cstr(TempNum)
else
encode=encode & "00" & cstr(TempNum)
end if
next
end function
'解密:
function decode(x)
for i=1 to len(x) step 4
decode=decode & chr(int("&H" & mid(x,i,4)))
next
end function
%>
<%=encode("http://www.gangzi.org/")%><br>
<%=decode("007700770077002E00670061006E0067007A0069002E006F00720067")%>



文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: -
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
t