| 关键词: nbsp regex matches Function xorstr replace true hexTmp destr IgnoreCase |
'=====================加密=============Function Encodestr(s,xorstr)Dim enFor i=1 To Len(s) en = en & hex (Asc(Mid(s,i,1)) Xor "&h"&xorstr)NextIf Len(s) Mod 2 >0 Then en = en & "00"End If Set regex=new regExp regex.pattern="(..)(..)" regex.IgnoreCase=true regex.global=true matches=regex.replace(en,"%u$2$1") Encodestr=LCase(matches)End Function '=================解密======================Function Decodestr(s,xorstr)Dim de,destrde=Replace(s,"%u","")set regex=new regExp regex.pattern="(..)(..)" regex.IgnoreCase=true regex.global=true matches=regex.replace(de,"$2$1")For i = 1 To Len(matches) step 2 hexTmp = Mid(matches,i,2) If hexTmp <> "00" Then destr = destr & CHR(CLng("&h" & hexTmp) Xor "&h"&xorstr) End IfNextDecodestr=LCase(destr)End Function |
|
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系
[邮箱地址] 删除
|