开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 1497|回复: 7
收起左侧

[已解决] 精易助手js调试成功,调用时时候什么返回空

 关闭 [复制链接]
结帖率:84% (63/75)
发表于 2018-6-23 18:05:37 | 显示全部楼层 |阅读模式   河南省郑州市
20精币
精易助手js调试成功,调用时时候什么返回空


QQ2.png
QQ截图20180623180508.png

最佳答案

查看完整内容

没问题吖~ 补充内容 (2018-6-23 18:16): 5b6762f978fabbee42a09204c0812d08ffe6965a 补充内容 (2018-6-23 18:17): 原来是你没有先执行加载~

回答提醒:如果本帖被关闭无法回复,您有更好的答案帮助楼主解决,请发表至 源码区 可获得加分喔。
友情提醒:本版被采纳的主题可在 申请荣誉值 页面申请荣誉值,获得 1点 荣誉值,荣誉值可兑换荣誉会员、终身vip用户组。
快捷通道:申请荣誉值无答案申请取消悬赏投诉有答案未采纳为最佳

签到天数: 17 天

发表于 2018-6-23 18:05:38 | 显示全部楼层   广东省广州市
没问题吖~

补充内容 (2018-6-23 18:16):
5b6762f978fabbee42a09204c0812d08ffe6965a

补充内容 (2018-6-23 18:17):
原来是你没有先执行加载~

1.e

94.81 KB, 下载次数: 14

评分

参与人数 1荣誉 +1 收起 理由
笨潴 + 1 热心帮助他人,荣誉+1,希望继续努力(*^__^*) 嘻嘻!

查看全部评分

回复

使用道具 举报

结帖率:84% (63/75)

签到天数: 1 天

 楼主| 发表于 2018-6-23 18:06:51 | 显示全部楼层   河南省郑州市
精易助手js调试成功,调用的时候返回空
回复

使用道具 举报

结帖率:100% (20/20)
发表于 2018-6-23 18:08:35 | 显示全部楼层   柬埔寨
你应该不JS 发出来看看

补充内容 (2018-6-23 18:08):
你应该把JS 发出来看看
回复

使用道具 举报

结帖率:84% (63/75)

签到天数: 1 天

 楼主| 发表于 2018-6-23 18:09:07 | 显示全部楼层   河南省郑州市
var Sha1 = {};  // Sha1 namespace  /**  * Generates SHA-1 hash of string  *  * @param {String} msg                String to be hashed  * @param {Boolean} [utf8encode=true] Encode msg as UTF-8 before generating hash  * @returns {String}                  Hash of msg as hex character string  */ Sha1.hash = function(msg, utf8encode) {   utf8encode =  (typeof utf8encode == 'undefined') ? true : utf8encode;      // convert string to UTF-8, as SHA only deals with byte-streams   if (utf8encode) msg = Utf8.encode(msg);      // constants [鎼?.2.1]   var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];      // PREPROCESSING       msg += String.fromCharCode(0x80);  // add trailing '1' bit (+ 0's padding) to string [鎼?.1.1]      // convert string msg into 512-bit/16-integer blocks arrays of ints [鎼?.2.1]   var l = msg.length/4 + 2;  // length (in 32-bit integers) of msg + 閳?閳?+ appended length   var N = Math.ceil(l/16);   // number of 16-integer-blocks required to hold 'l' ints   var M = new Array(N);      for (var i=0; i<N; i++) {     M = new Array(16);     for (var j=0; j<16; j++) {  // encode 4 chars per integer, big-endian encoding       M[j] = (msg.charCodeAt(i*64+j*4)<<24) | (msg.charCodeAt(i*64+j*4+1)<<16) |          (msg.charCodeAt(i*64+j*4+2)<<8) | (msg.charCodeAt(i*64+j*4+3));     } // note running off the end of msg is ok 'cos bitwise ops on NaN return 0   }   // add length (in bits) into final pair of 32-bit integers (big-endian) [鎼?.1.1]   // note: most significant word would be (len-1)*8 >>> 32, but since JS converts   // bitwise-op args to 32 bits, we need to simulate this by arithmetic operators   M[N-1][14] = ((msg.length-1)*8) / Math.pow(2, 32); M[N-1][14] = Math.floor(M[N-1][14])   M[N-1][15] = ((msg.length-1)*8) & 0xffffffff;      // set initial hash value [鎼?.3.1]   var H0 = 0x67452301;   var H1 = 0xefcdab89;   var H2 = 0x98badcfe;   var H3 = 0x10325476;   var H4 = 0xc3d2e1f0;      // HASH COMPUTATION [鎼?.1.2]      var W = new Array(80); var a, b, c, d, e;   for (var i=0; i<N; i++) {        // 1 - prepare message schedule 'W'     for (var t=0;  t<16; t++) W[t] = M[t];     for (var t=16; t<80; t++) W[t] = Sha1.ROTL(W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16], 1);          // 2 - initialise five working variables a, b, c, d, e with previous hash value     a = H0; b = H1; c = H2; d = H3; e = H4;          // 3 - main loop     for (var t=0; t<80; t++) {       var s = Math.floor(t/20); // seq for blocks of 'f' functions and 'K' constants       var T = (Sha1.ROTL(a,5) + Sha1.f(s,b,c,d) + e + K + W[t]) & 0xffffffff;       e = d;       d = c;       c = Sha1.ROTL(b, 30);       b = a;       a = T;     }          // 4 - compute the new intermediate hash value     H0 = (H0+a) & 0xffffffff;  // note 'addition modulo 2^32'     H1 = (H1+b) & 0xffffffff;      H2 = (H2+c) & 0xffffffff;      H3 = (H3+d) & 0xffffffff;      H4 = (H4+e) & 0xffffffff;   }    return Sha1.toHexStr(H0) + Sha1.toHexStr(H1) +      Sha1.toHexStr(H2) + Sha1.toHexStr(H3) + Sha1.toHexStr(H4); }  // // function 'f' [鎼?.1.1] // Sha1.f = function(s, x, y, z)  {   switch (s) {   case 0: return (x & y) ^ (~x & z);           // Ch()   case 1: return x ^ y ^ z;                    // Parity()   case 2: return (x & y) ^ (x & z) ^ (y & z);  // Maj()   case 3: return x ^ y ^ z;                    // Parity()   } }  // // rotate left (circular left shift) value x by n positions [鎼?.2.5] // Sha1.ROTL = function(x, n) {   return (x<<n) | (x>>>(32-n)); }  // // hexadecimal representation of a number  //   (note toString(16) is implementation-dependant, and   //   in IE returns signed numbers when used on full words) // Sha1.toHexStr = function(n) {   var s="", v;   for (var i=7; i>=0; i--) { v = (n>>>(i*4)) & 0xf; s += v.toString(16); }   return s; }   /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */ /*  Utf8 class: encode / decode between multi-byte Unicode characters and UTF-8 multiple          */ /*              single-byte character encoding (c) Chris Veness 2002-2010                         */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */  var Utf8 = {};  // Utf8 namespace  /**  * Encode multi-byte Unicode string into utf-8 multiple single-byte characters   * (BMP / basic multilingual plane only)  *  * Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars  *  * @param {String} strUni Unicode string to be encoded as UTF-8  * @returns {String} encoded string  */ Utf8.encode = function(strUni) {   // use regular expressions & String.replace callback function for better efficiency    // than procedural approaches   var strUtf = strUni.replace(       /[\u0080-\u07ff]/g,  // U+0080 - U+07FF => 2 bytes 110yyyyy, 10zzzzzz       function(c) {          var cc = c.charCodeAt(0);         return String.fromCharCode(0xc0 | cc>>6, 0x80 | cc&0x3f); }     );   strUtf = strUtf.replace(       /[\u0800-\uffff]/g,  // U+0800 - U+FFFF => 3 bytes 1110xxxx, 10yyyyyy, 10zzzzzz       function(c) {          var cc = c.charCodeAt(0);          return String.fromCharCode(0xe0 | cc>>12, 0x80 | cc>>6&0x3F, 0x80 | cc&0x3f); }     );   return strUtf; }  /**  * Decode utf-8 encoded string back into multi-byte Unicode characters  *  * @param {String} strUtf UTF-8 string to be decoded back to Unicode  * @returns {String} decoded string  */ Utf8.decode = function(strUtf) {   // note: decode 3-byte chars first as decoded 2-byte strings could appear to be 3-byte char!   var strUni = strUtf.replace(       /[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,  // 3-byte chars       function(c) {  // (note parentheses for precence)         var cc = ((c.charCodeAt(0)&0x0f)<<12) | ((c.charCodeAt(1)&0x3f)<<6) | ( c.charCodeAt(2)&0x3f);          return String.fromCharCode(cc); }     );   strUni = strUni.replace(       /[\u00c0-\u00df][\u0080-\u00bf]/g,                 // 2-byte chars       function(c) {  // (note parentheses for precence)         var cc = (c.charCodeAt(0)&0x1f)<<6 | c.charCodeAt(1)&0x3f;         return String.fromCharCode(cc); }     );   return strUni; }  function a(nonce,ts,pwd){ pwd = Sha1.hash(pwd)                                 return Sha1.hash(nonce+ts+pwd); }
回复

使用道具 举报

结帖率:84% (63/75)

签到天数: 1 天

 楼主| 发表于 2018-6-23 18:09:40 | 显示全部楼层   河南省郑州市
  1. var Sha1 = {};  // Sha1 namespace

  2. /**
  3. * Generates SHA-1 hash of string
  4. *
  5. * [url=home.php?mod=space&uid=275307]@param[/url] {String} msg                String to be hashed
  6. * @param {Boolean} [utf8encode=true] Encode msg as UTF-8 before generating hash
  7. * @returns {String}                  Hash of msg as hex character string
  8. */
  9. Sha1.hash = function(msg, utf8encode) {
  10.   utf8encode =  (typeof utf8encode == 'undefined') ? true : utf8encode;
  11.   
  12.   // convert string to UTF-8, as SHA only deals with byte-streams
  13.   if (utf8encode) msg = Utf8.encode(msg);
  14.   
  15.   // constants [鎼?.2.1]
  16.   var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
  17.   
  18.   // PREPROCESSING
  19.   
  20.   msg += String.fromCharCode(0x80);  // add trailing '1' bit (+ 0's padding) to string [鎼?.1.1]
  21.   
  22.   // convert string msg into 512-bit/16-integer blocks arrays of ints [鎼?.2.1]
  23.   var l = msg.length/4 + 2;  // length (in 32-bit integers) of msg + 閳?閳?+ appended length
  24.   var N = Math.ceil(l/16);   // number of 16-integer-blocks required to hold 'l' ints
  25.   var M = new Array(N);
  26.   
  27.   for (var i=0; i<N; i++) {
  28.     M[i] = new Array(16);
  29.     for (var j=0; j<16; j++) {  // encode 4 chars per integer, big-endian encoding
  30.       M[i][j] = (msg.charCodeAt(i*64+j*4)<<24) | (msg.charCodeAt(i*64+j*4+1)<<16) |
  31.         (msg.charCodeAt(i*64+j*4+2)<<8) | (msg.charCodeAt(i*64+j*4+3));
  32.     } // note running off the end of msg is ok 'cos bitwise ops on NaN return 0
  33.   }
  34.   // add length (in bits) into final pair of 32-bit integers (big-endian) [鎼?.1.1]
  35.   // note: most significant word would be (len-1)*8 >>> 32, but since JS converts
  36.   // bitwise-op args to 32 bits, we need to simulate this by arithmetic operators
  37.   M[N-1][14] = ((msg.length-1)*8) / Math.pow(2, 32); M[N-1][14] = Math.floor(M[N-1][14])
  38.   M[N-1][15] = ((msg.length-1)*8) & 0xffffffff;
  39.   
  40.   // set initial hash value [鎼?.3.1]
  41.   var H0 = 0x67452301;
  42.   var H1 = 0xefcdab89;
  43.   var H2 = 0x98badcfe;
  44.   var H3 = 0x10325476;
  45.   var H4 = 0xc3d2e1f0;
  46.   
  47.   // HASH COMPUTATION [鎼?.1.2]
  48.   
  49.   var W = new Array(80); var a, b, c, d, e;
  50.   for (var i=0; i<N; i++) {
  51.   
  52.     // 1 - prepare message schedule 'W'
  53.     for (var t=0;  t<16; t++) W[t] = M[i][t];
  54.     for (var t=16; t<80; t++) W[t] = Sha1.ROTL(W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16], 1);
  55.    
  56.     // 2 - initialise five working variables a, b, c, d, e with previous hash value
  57.     a = H0; b = H1; c = H2; d = H3; e = H4;
  58.    
  59.     // 3 - main loop
  60.     for (var t=0; t<80; t++) {
  61.       var s = Math.floor(t/20); // seq for blocks of 'f' functions and 'K' constants
  62.       var T = (Sha1.ROTL(a,5) + Sha1.f(s,b,c,d) + e + K[s] + W[t]) & 0xffffffff;
  63.       e = d;
  64.       d = c;
  65.       c = Sha1.ROTL(b, 30);
  66.       b = a;
  67.       a = T;
  68.     }
  69.    
  70.     // 4 - compute the new intermediate hash value
  71.     H0 = (H0+a) & 0xffffffff;  // note 'addition modulo 2^32'
  72.     H1 = (H1+b) & 0xffffffff;
  73.     H2 = (H2+c) & 0xffffffff;
  74.     H3 = (H3+d) & 0xffffffff;
  75.     H4 = (H4+e) & 0xffffffff;
  76.   }

  77.   return Sha1.toHexStr(H0) + Sha1.toHexStr(H1) +
  78.     Sha1.toHexStr(H2) + Sha1.toHexStr(H3) + Sha1.toHexStr(H4);
  79. }

  80. //
  81. // function 'f' [鎼?.1.1]
  82. //
  83. Sha1.f = function(s, x, y, z)  {
  84.   switch (s) {
  85.   case 0: return (x & y) ^ (~x & z);           // Ch()
  86.   case 1: return x ^ y ^ z;                    // Parity()
  87.   case 2: return (x & y) ^ (x & z) ^ (y & z);  // Maj()
  88.   case 3: return x ^ y ^ z;                    // Parity()
  89.   }
  90. }

  91. //
  92. // rotate left (circular left shift) value x by n positions [鎼?.2.5]
  93. //
  94. Sha1.ROTL = function(x, n) {
  95.   return (x<<n) | (x>>>(32-n));
  96. }

  97. //
  98. // hexadecimal representation of a number
  99. //   (note toString(16) is implementation-dependant, and  
  100. //   in IE returns signed numbers when used on full words)
  101. //
  102. Sha1.toHexStr = function(n) {
  103.   var s="", v;
  104.   for (var i=7; i>=0; i--) { v = (n>>>(i*4)) & 0xf; s += v.toString(16); }
  105.   return s;
  106. }


  107. /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
  108. /*  Utf8 class: encode / decode between multi-byte Unicode characters and UTF-8 multiple          */
  109. /*              single-byte character encoding (c) Chris Veness 2002-2010                         */
  110. /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

  111. var Utf8 = {};  // Utf8 namespace

  112. /**
  113. * Encode multi-byte Unicode string into utf-8 multiple single-byte characters
  114. * (BMP / basic multilingual plane only)
  115. *
  116. * Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars
  117. *
  118. * @param {String} strUni Unicode string to be encoded as UTF-8
  119. * @returns {String} encoded string
  120. */
  121. Utf8.encode = function(strUni) {
  122.   // use regular expressions & String.replace callback function for better efficiency
  123.   // than procedural approaches
  124.   var strUtf = strUni.replace(
  125.       /[\u0080-\u07ff]/g,  // U+0080 - U+07FF => 2 bytes 110yyyyy, 10zzzzzz
  126.       function(c) {
  127.         var cc = c.charCodeAt(0);
  128.         return String.fromCharCode(0xc0 | cc>>6, 0x80 | cc&0x3f); }
  129.     );
  130.   strUtf = strUtf.replace(
  131.       /[\u0800-\uffff]/g,  // U+0800 - U+FFFF => 3 bytes 1110xxxx, 10yyyyyy, 10zzzzzz
  132.       function(c) {
  133.         var cc = c.charCodeAt(0);
  134.         return String.fromCharCode(0xe0 | cc>>12, 0x80 | cc>>6&0x3F, 0x80 | cc&0x3f); }
  135.     );
  136.   return strUtf;
  137. }

  138. /**
  139. * Decode utf-8 encoded string back into multi-byte Unicode characters
  140. *
  141. * @param {String} strUtf UTF-8 string to be decoded back to Unicode
  142. * @returns {String} decoded string
  143. */
  144. Utf8.decode = function(strUtf) {
  145.   // note: decode 3-byte chars first as decoded 2-byte strings could appear to be 3-byte char!
  146.   var strUni = strUtf.replace(
  147.       /[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,  // 3-byte chars
  148.       function(c) {  // (note parentheses for precence)
  149.         var cc = ((c.charCodeAt(0)&0x0f)<<12) | ((c.charCodeAt(1)&0x3f)<<6) | ( c.charCodeAt(2)&0x3f);
  150.         return String.fromCharCode(cc); }
  151.     );
  152.   strUni = strUni.replace(
  153.       /[\u00c0-\u00df][\u0080-\u00bf]/g,                 // 2-byte chars
  154.       function(c) {  // (note parentheses for precence)
  155.         var cc = (c.charCodeAt(0)&0x1f)<<6 | c.charCodeAt(1)&0x3f;
  156.         return String.fromCharCode(cc); }
  157.     );
  158.   return strUni;
  159. }

  160. function a(nonce,ts,pwd){
  161. pwd = Sha1.hash(pwd)
  162.                                 return Sha1.hash(nonce+ts+pwd);
  163. }
复制代码
回复

使用道具 举报

结帖率:84% (63/75)

签到天数: 1 天

 楼主| 发表于 2018-6-23 18:12:04 | 显示全部楼层   河南省郑州市
代码上传不了,都写在文档里面了

新建文本文档.txt

5.26 KB, 下载次数: 1

回复

使用道具 举报

结帖率:84% (63/75)

签到天数: 1 天

 楼主| 发表于 2018-6-23 18:15:32 | 显示全部楼层   河南省郑州市
  1. var Sha1 = {};  // Sha1 namespace

  2. /**
  3. * Generates SHA-1 hash of string
  4. *
  5. * [url=home.php?mod=space&uid=275307]@param[/url] {String} msg                String to be hashed
  6. * @param {Boolean} [utf8encode=true] Encode msg as UTF-8 before generating hash
  7. * @returns {String}                  Hash of msg as hex character string
  8. */
  9. Sha1.hash = function(msg, utf8encode) {
  10.   utf8encode =  (typeof utf8encode == 'undefined') ? true : utf8encode;
  11.   
  12.   // convert string to UTF-8, as SHA only deals with byte-streams
  13.   if (utf8encode) msg = Utf8.encode(msg);
  14.   
  15.   // constants [鎼?.2.1]
  16.   var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
  17.   
  18.   // PREPROCESSING
  19.   
  20.   msg += String.fromCharCode(0x80);  // add trailing '1' bit (+ 0's padding) to string [鎼?.1.1]
  21.   
  22.   // convert string msg into 512-bit/16-integer blocks arrays of ints [鎼?.2.1]
  23.   var l = msg.length/4 + 2;  // length (in 32-bit integers) of msg + 閳?閳?+ appended length
  24.   var N = Math.ceil(l/16);   // number of 16-integer-blocks required to hold 'l' ints
  25.   var M = new Array(N);
  26.   
  27.   for (var i=0; i<N; i++) {
  28.     M[i] = new Array(16);
  29.     for (var j=0; j<16; j++) {  // encode 4 chars per integer, big-endian encoding
  30.       M[i][j] = (msg.charCodeAt(i*64+j*4)<<24) | (msg.charCodeAt(i*64+j*4+1)<<16) |
  31.         (msg.charCodeAt(i*64+j*4+2)<<8) | (msg.charCodeAt(i*64+j*4+3));
  32.     } // note running off the end of msg is ok 'cos bitwise ops on NaN return 0
  33.   }
  34.   // add length (in bits) into final pair of 32-bit integers (big-endian) [鎼?.1.1]
  35.   // note: most significant word would be (len-1)*8 >>> 32, but since JS converts
  36.   // bitwise-op args to 32 bits, we need to simulate this by arithmetic operators
  37.   M[N-1][14] = ((msg.length-1)*8) / Math.pow(2, 32); M[N-1][14] = Math.floor(M[N-1][14])
  38.   M[N-1][15] = ((msg.length-1)*8) & 0xffffffff;
  39.   
  40.   // set initial hash value [鎼?.3.1]
  41.   var H0 = 0x67452301;
  42.   var H1 = 0xefcdab89;
  43.   var H2 = 0x98badcfe;
  44.   var H3 = 0x10325476;
  45.   var H4 = 0xc3d2e1f0;
  46.   
  47.   // HASH COMPUTATION [鎼?.1.2]
  48.   
  49.   var W = new Array(80); var a, b, c, d, e;
  50.   for (var i=0; i<N; i++) {
  51.   
  52.     // 1 - prepare message schedule 'W'
  53.     for (var t=0;  t<16; t++) W[t] = M[i][t];
  54.     for (var t=16; t<80; t++) W[t] = Sha1.ROTL(W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16], 1);
  55.    
  56.     // 2 - initialise five working variables a, b, c, d, e with previous hash value
  57.     a = H0; b = H1; c = H2; d = H3; e = H4;
  58.    
  59.     // 3 - main loop
  60.     for (var t=0; t<80; t++) {
  61.       var s = Math.floor(t/20); // seq for blocks of 'f' functions and 'K' constants
  62.       var T = (Sha1.ROTL(a,5) + Sha1.f(s,b,c,d) + e + K[s] + W[t]) & 0xffffffff;
  63.       e = d;
  64.       d = c;
  65.       c = Sha1.ROTL(b, 30);
  66.       b = a;
  67.       a = T;
  68.     }
  69.    
  70.     // 4 - compute the new intermediate hash value
  71.     H0 = (H0+a) & 0xffffffff;  // note 'addition modulo 2^32'
  72.     H1 = (H1+b) & 0xffffffff;
  73.     H2 = (H2+c) & 0xffffffff;
  74.     H3 = (H3+d) & 0xffffffff;
  75.     H4 = (H4+e) & 0xffffffff;
  76.   }

  77.   return Sha1.toHexStr(H0) + Sha1.toHexStr(H1) +
  78.     Sha1.toHexStr(H2) + Sha1.toHexStr(H3) + Sha1.toHexStr(H4);
  79. }

  80. //
  81. // function 'f' [鎼?.1.1]
  82. //
  83. Sha1.f = function(s, x, y, z)  {
  84.   switch (s) {
  85.   case 0: return (x & y) ^ (~x & z);           // Ch()
  86.   case 1: return x ^ y ^ z;                    // Parity()
  87.   case 2: return (x & y) ^ (x & z) ^ (y & z);  // Maj()
  88.   case 3: return x ^ y ^ z;                    // Parity()
  89.   }
  90. }

  91. //
  92. // rotate left (circular left shift) value x by n positions [鎼?.2.5]
  93. //
  94. Sha1.ROTL = function(x, n) {
  95.   return (x<<n) | (x>>>(32-n));
  96. }

  97. //
  98. // hexadecimal representation of a number
  99. //   (note toString(16) is implementation-dependant, and  
  100. //   in IE returns signed numbers when used on full words)
  101. //
  102. Sha1.toHexStr = function(n) {
  103.   var s="", v;
  104.   for (var i=7; i>=0; i--) { v = (n>>>(i*4)) & 0xf; s += v.toString(16); }
  105.   return s;
  106. }


  107. /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
  108. /*  Utf8 class: encode / decode between multi-byte Unicode characters and UTF-8 multiple          */
  109. /*              single-byte character encoding (c) Chris Veness 2002-2010                         */
  110. /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

  111. var Utf8 = {};  // Utf8 namespace

  112. /**
  113. * Encode multi-byte Unicode string into utf-8 multiple single-byte characters
  114. * (BMP / basic multilingual plane only)
  115. *
  116. * Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars
  117. *
  118. * @param {String} strUni Unicode string to be encoded as UTF-8
  119. * @returns {String} encoded string
  120. */
  121. Utf8.encode = function(strUni) {
  122.   // use regular expressions & String.replace callback function for better efficiency
  123.   // than procedural approaches
  124.   var strUtf = strUni.replace(
  125.       /[\u0080-\u07ff]/g,  // U+0080 - U+07FF => 2 bytes 110yyyyy, 10zzzzzz
  126.       function(c) {
  127.         var cc = c.charCodeAt(0);
  128.         return String.fromCharCode(0xc0 | cc>>6, 0x80 | cc&0x3f); }
  129.     );
  130.   strUtf = strUtf.replace(
  131.       /[\u0800-\uffff]/g,  // U+0800 - U+FFFF => 3 bytes 1110xxxx, 10yyyyyy, 10zzzzzz
  132.       function(c) {
  133.         var cc = c.charCodeAt(0);
  134.         return String.fromCharCode(0xe0 | cc>>12, 0x80 | cc>>6&0x3F, 0x80 | cc&0x3f); }
  135.     );
  136.   return strUtf;
  137. }

  138. /**
  139. * Decode utf-8 encoded string back into multi-byte Unicode characters
  140. *
  141. * @param {String} strUtf UTF-8 string to be decoded back to Unicode
  142. * @returns {String} decoded string
  143. */
  144. Utf8.decode = function(strUtf) {
  145.   // note: decode 3-byte chars first as decoded 2-byte strings could appear to be 3-byte char!
  146.   var strUni = strUtf.replace(
  147.       /[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,  // 3-byte chars
  148.       function(c) {  // (note parentheses for precence)
  149.         var cc = ((c.charCodeAt(0)&0x0f)<<12) | ((c.charCodeAt(1)&0x3f)<<6) | ( c.charCodeAt(2)&0x3f);
  150.         return String.fromCharCode(cc); }
  151.     );
  152.   strUni = strUni.replace(
  153.       /[\u00c0-\u00df][\u0080-\u00bf]/g,                 // 2-byte chars
  154.       function(c) {  // (note parentheses for precence)
  155.         var cc = (c.charCodeAt(0)&0x1f)<<6 | c.charCodeAt(1)&0x3f;
  156.         return String.fromCharCode(cc); }
  157.     );
  158.   return strUni;
  159. }

  160. function a(nonce,ts,pwd){
  161. pwd = Sha1.hash(pwd)
  162.                                 return Sha1.hash(nonce+ts+pwd);
  163. }
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 诚聘英才| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 800073686,邮箱:800073686@b.qq.com
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表