Javascript脚本实现静态网页加密实例代码(5)

md5_vm_test:function(){return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";},

 safe_add:
  function(x, y){
    var lsw = (x & 0xFFFF) + (y & 0xFFFF);
    var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
    return (msw << 16) | (lsw & 0xFFFF);
  },

 str2binl:
  function(str){
    var bin = Array();
    var mask = (1 << this.chrsz) - 1;
    for(var i = 0; i < str.length * this.chrsz; i += this.chrsz)
      bin[i>>5] |= (str.charCodeAt(i / this.chrsz) & mask) << (i%32);
    return bin;
  },

str_hmac_md5:function(key, data){ return binl2str(core_hmac_md5(key, data)); },

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdzwfg.html