我需要转换为ASP Classic中的javascript函数,但是我没有得到。

如果有人可以帮助我,我将不胜感激。

这是代码:

<script type="text/javascript">
function decrypt(str, key1, key2) {

   var loc1 = [];

   for (var loc3 = 0; loc3 < str.length; ++loc3) {
      loc1.push(("000" + parseInt(str.charAt(loc3), 16).toString(2)).slice(-4));
   }

   loc1 = loc1.join("").split("");

   var loc6 = [];

   for (var loc3 = 0; loc3 < 384; ++loc3) {
      key1 = (key1 * 11 + 77213) % 81371;
      key2 = (key2 * 17 + 92717) % 192811;
      loc6[loc3] = (key1 + key2) % 128;
   }

   for (var loc3 = 256; loc3 >= 0; --loc3) {
      var loc5 = loc6[loc3];
      var loc4 = loc3 % 128;
      var loc8 = loc1[loc5];
      loc1[loc5] = loc1[loc4];
      loc1[loc4] = loc8;
   }

   for (var loc3 = 0; loc3 < 128; ++loc3) {
      loc1[loc3] = loc1[loc3] ^ loc6[loc3 + 256] & 1;
   }

   var loc12 = loc1.join("");
   var loc7 = [];

   for (var loc3 = 0; loc3 < loc12.length; loc3 = loc3 + 4) {
      var loc9 = loc12.substr(loc3, 4);
      loc7.push(loc9);
   }

   var loc2 = [];

   for (var loc3 = 0; loc3 < loc7.length; ++loc3) {
      loc2.push(parseInt(loc7[loc3], 2).toString(16));
   }
   return loc2.join("");
}
</script>


请任何可以帮助我的人,谢谢!谢谢

最佳答案

您可以在服务器上运行javascript。
将您的开始脚本标签更改为此:

<script language="JScript" runat="server">


并尝试运行以查看结果

09-20 21:24