开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

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

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


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

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

查看: 1073|回复: 3
收起左侧

[已解决] js帮我大佬看看

 关闭 [复制链接]
结帖率:97% (31/32)
发表于 2020-5-5 13:17:46 | 显示全部楼层 |阅读模式   贵州省*
5精币
这里下面是js代码  。麻烦哪位大佬帮帮忙 这里是他全部的js代码


_02Hb = function(t, e, r) {
     var n;
     n = function() {
         var t = t || function(t, e) {
                 var r = Object.create || function() {
                         function t() {}
                         return function(e) {
                             var r;
                             return t.prototype = e,
                             r = new t,
                             t.prototype = null,
                             r
                         }
                     }(),
                     n = {}, o = n.lib = {}, i = o.Base = {
                         extend: function(t) {
                             var e = r(this);
                             return t && e.mixIn(t),
                             e.hasOwnProperty("init") && this.init !== e.init || (e.init = function() {
                                 e.$super.init.apply(this, arguments)
                             }),
                             e.init.prototype = e,
                             e.$super = this,
                             e
                         },
                         create: function() {
                             var t = this.extend();
                             return t.init.apply(t, arguments),
                             t
                         },
                         init: function() {},
                         mixIn: function(t) {
                             for (var e in t)
                             t.hasOwnProperty(e) && (this[e] = t[e]);
                             t.hasOwnProperty("toString") && (this.toString = t.toString)
                         },
                         clone: function() {
                             return this.init.prototype.extend(this)
                         }
                     }, c = o.WordArray = i.extend({
                         init: function(t, e) {
                             t = this.words = t || [],
                             this.sigBytes = void 0 != e ? e : 4 * t.length
                         },
                         toString: function(t) {
                             return (t || s).stringify(this)
                         },
                         concat: function(t) {
                             var e = this.words,
                                 r = t.words,
                                 n = this.sigBytes,
                                 o = t.sigBytes;
                             if (this.clamp(),
                             n % 4) for (var i = 0; i < o; i++) {
                                 var c = r[i >>> 2] >>> 24 - i % 4 * 8 & 255;
                                 e[n + i >>> 2] |= c << 24 - (n + i) % 4 * 8
                             } else for (i = 0; i < o; i += 4)
                             e[n + i >>> 2] = r[i >>> 2];
                             return this.sigBytes += o,
                             this
                         },
                         clamp: function() {
                             var e = this.words,
                                 r = this.sigBytes;
                             e[r >>> 2] &= 4294967295 << 32 - r % 4 * 8,
                             e.length = t.ceil(r / 4)
                         },
                         clone: function() {
                             var t = i.clone.call(this);
                             return t.words = this.words.slice(0),
                             t
                         },
                         random: function(e) {
                             for (var r, n = [], o = function(e) {
                                 e = e;
                                 var r = 987654321,
                                     n = 4294967295;
                                 return function() {
                                     var o = ((r = 36969 * (65535 & r) + (r >> 16) & n) << 16) + (e = 18e3 * (65535 & e) + (e >> 16) & n) & n;
                                     return o /= 4294967296, (o += .5) * (t.random() > .5 ? 1 : -1)
                                 }
                             }, i = 0; i < e; i += 4) {
                                 var a = o(4294967296 * (r || t.random()));
                                 r = 987654071 * a(),
                                 n.push(4294967296 * a() | 0)
                             }
                             return new c.init(n, e)
                         }
                     }),
                     a = n.enc = {}, s = a.Hex = {
                         stringify: function(t) {
                             for (var e = t.words, r = t.sigBytes, n = [], o = 0; o < r; o++) {
                                 var i = e[o >>> 2] >>> 24 - o % 4 * 8 & 255;
                                 n.push((i >>> 4).toString(16)),
                                 n.push((15 & i).toString(16))
                             }
                             return n.join("")
                         },
                         parse: function(t) {
                             for (var e = t.length, r = [], n = 0; n < e; n += 2)
                             r[n >>> 3] |= parseInt(t.substr(n, 2), 16) << 24 - n % 8 * 4;
                             return new c.init(r, e / 2)
                         }
                     }, u = a.Latin1 = {
                         stringify: function(t) {
                             for (var e = t.words, r = t.sigBytes, n = [], o = 0; o < r; o++) {
                                 var i = e[o >>> 2] >>> 24 - o % 4 * 8 & 255;
                                 n.push(String.fromCharCode(i))
                             }
                             return n.join("")
                         },
                         parse: function(t) {
                             for (var e = t.length, r = [], n = 0; n < e; n++)
                             r[n >>> 2] |= (255 & t.charCodeAt(n)) << 24 - n % 4 * 8;
                             return new c.init(r, e)
                         }
                     }, f = a.Utf8 = {
                         stringify: function(t) {
                             try {
                                 return decodeURIComponent(escape(u.stringify(t)))
                             } catch (t) {
                                 throw new Error("Malformed UTF-8 data")
                             }
                         },
                         parse: function(t) {
                             return u.parse(unescape(encodeURIComponent(t)))
                         }
                     }, l = o.BufferedBlockAlgorithm = i.extend({
                         reset: function() {
                             this._data = new c.init,
                             this._nDataBytes = 0
                         },
                         _append: function(t) {
                             "string" == typeof t && (t = f.parse(t)),
                             this._data.concat(t),
                             this._nDataBytes += t.sigBytes
                         },
                         _process: function(e) {
                             var r = this._data,
                                 n = r.words,
                                 o = r.sigBytes,
                                 i = this.blockSize,
                                 a = o / (4 * i),
                                 s = (a = e ? t.ceil(a) : t.max((0 | a) - this._minBufferSize, 0)) * i,
                                 u = t.min(4 * s, o);
                             if (s) {
                                 for (var f = 0; f < s; f += i)
                                 this._doProcessBlock(n, f);
                                 var l = n.splice(0, s);
                                 r.sigBytes -= u
                             }
                             return new c.init(l, u)
                         },
                         clone: function() {
                             var t = i.clone.call(this);
                             return t._data = this._data.clone(),
                             t
                         },
                         _minBufferSize: 0
                     }),
                     h = (o.Hasher = l.extend({
                         cfg: i.extend(),
                         init: function(t) {
                             this.cfg = this.cfg.extend(t),
                             this.reset()
                         },
                         reset: function() {
                             l.reset.call(this),
                             this._doReset()
                         },
                         update: function(t) {
                             return this._append(t),
                             this._process(),
                             this
                         },
                         finalize: function(t) {
                             return t && this._append(t),
                             this._doFinalize()
                         },
                         blockSize: 16,
                         _createHelper: function(t) {
                             return function(e, r) {
                                 return new t.init(r).finalize(e)
                             }
                         },
                         _createHmacHelper: function(t) {
                             return function(e, r) {
                                 return new h.HMAC.init(t, r).finalize(e)
                             }
                         }
                     }),
                     n.algo = {});
                 return n
             }(Math);
         return t
     },
     t.exports = n()
}
PIk1 = function(t, e, r) {
     var n;
     n = function(t) {
         var e, r, n;
         r = (e = t).lib.Base,
         n = e.enc.Utf8,
         e.algo.HMAC = r.extend({
             init: function(t, e) {
                 t = this._hasher = new t.init,
                     "string" == typeof e && (e = n.parse(e));
                 var r = t.blockSize,
                     o = 4 * r;
                 e.sigBytes > o && (e = t.finalize(e)),
                 e.clamp();
                 for (var i = this._oKey = e.clone(), c = this._iKey = e.clone(), a = i.words, s = c.words, u = 0; u < r; u++)
                 a[u] ^= 1549556828,
                 s[u] ^= 909522486;
                 i.sigBytes = c.sigBytes = o,
                 this.reset()
             },
             reset: function() {
                 var t = this._hasher;
                 t.reset(),
                 t.update(this._iKey)
             },
             update: function(t) {
                 return this._hasher.update(t),
                 this
             },
             finalize: function(t) {
                 var e = this._hasher,
                     r = e.finalize(t);
                 return e.reset(),
                 e.finalize(this._oKey.clone().concat(r))
             }
         })
     },
     t.exports = n(r(_02Hb))
}
_6qVS = function(t, e, r) {
     var n;
     n = function(t) {
         return function() {
             if ("function" == typeof ArrayBuffer) {
                 var e = t.lib.WordArray,
                     r = e.init;
                 (e.init = function(t) {
                     if (t instanceof ArrayBuffer && (t = new Uint8Array(t)), (t instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array) && (t = new Uint8Array(t.buffer, t.byteOffset, t.byteLength)),
                     t instanceof Uint8Array) {
                         for (var e = t.byteLength, n = [], o = 0; o < e; o++)
                         n[o >>> 2] |= t[o] << 24 - o % 4 * 8;
                         r.call(this, n, e)
                     } else r.apply(this, arguments)
                 }).prototype = e
             }
         }(),
         t.lib.WordArray
     },
     t.exports = n(r(_02Hb))
}
mP1F = function(t, e, r) {
     var n;
     n = function(t) {
         return function(e) {
             var r = t,
                 n = r.lib,
                 o = n.WordArray,
                 i = n.Hasher,
                 c = r.algo,
                 a = [],
                 s = [];
             ! function() {
                 function t(t) {
                     for (var r = e.sqrt(t), n = 2; n <= r; n++)
                     if (!(t % n)) return !1;
                     return !0
                 }
                 function r(t) {
                     return 4294967296 * (t - (0 | t)) | 0
                 }
                 for (var n = 2, o = 0; o < 64;)
                 t(n) && (o < 8 && (a[o] = r(e.pow(n, .5))),
                 s[o] = r(e.pow(n, 1 / 3)),
                 o++),
                 n++
             }();
             var u = [],
                 f = c.SHA256 = i.extend({
                     _doReset: function() {
                         this._hash = new o.init(a.slice(0))
                     },
                     _doProcessBlock: function(t, e) {
                         for (var r = this._hash.words, n = r[0], o = r[1], i = r[2], c = r[3], a = r[4], f = r[5], l = r[6], h = r[7], p = 0; p < 64; p++) {
                             if (p < 16) u[p] = 0 | t[e + p];
                             else {
                                 var d = u[p - 15],
                                     v = (d << 25 | d >>> 7) ^ (d << 14 | d >>> 18) ^ d >>> 3,
                                     y = u[p - 2],
                                     _ = (y << 15 | y >>> 17) ^ (y << 13 | y >>> 19) ^ y >>> 10;
                                 u[p] = v + u[p - 7] + _ + u[p - 16]
                             }
                             var g = n & o ^ n & i ^ o & i,
                                 m = (n << 30 | n >>> 2) ^ (n << 19 | n >>> 13) ^ (n << 10 | n >>> 22),
                                 w = h + ((a << 26 | a >>> 6) ^ (a << 21 | a >>> 11) ^ (a << 7 | a >>> 25)) + (a & f ^ ~a & l) + s[p] + u[p];
                             h = l,
                             l = f,
                             f = a,
                             a = c + w | 0,
                             c = i,
                             i = o,
                             o = n,
                             n = w + (m + g) | 0
                         }
                         r[0] = r[0] + n | 0,
                         r[1] = r[1] + o | 0,
                         r[2] = r[2] + i | 0,
                         r[3] = r[3] + c | 0,
                         r[4] = r[4] + a | 0,
                         r[5] = r[5] + f | 0,
                         r[6] = r[6] + l | 0,
                         r[7] = r[7] + h | 0
                     },
                     _doFinalize: function() {
                         var t = this._data,
                             r = t.words,
                             n = 8 * this._nDataBytes,
                             o = 8 * t.sigBytes;
                         return r[o >>> 5] |= 128 << 24 - o % 32,
                         r[14 + (o + 64 >>> 9 << 4)] = e.floor(n / 4294967296),
                         r[15 + (o + 64 >>> 9 << 4)] = n,
                         t.sigBytes = 4 * r.length,
                         this._process(),
                         this._hash
                     },
                     clone: function() {
                         var t = i.clone.call(this);
                         return t._hash = this._hash.clone(),
                         t
                     }
                 });
             r.SHA256 = i._createHelper(f),
             r.HmacSHA256 = i._createHmacHelper(f)
         }(Math),
         t.SHA256
     },
     t.exports = n(r(_02Hb))
}

//运行出来的代码="ce4394f848c4428a8b03b74d48de6a7804b5093ac60bbad1bfa5fbcb1284fb68"
function fet(l) {
//u="80TD9QXUGHOEZLkcmB5h3uSpWvqNlfoM"
//a="1588654931"
//l="{"password":"123456","phone":"15885886622"}"
   //  var a =p.a.HmacSHA256(l + "." + a, u).toString();
   //  return a
}

JS代码.txt

15.7 KB, 下载次数: 7

这是代码

最佳答案

查看完整内容

[md]我计算出来是: 80d381c4a86e51c28b400cb822f0e4a7ed28108570185a5f1f3770fd7de9dc1a ```JavaScript var CryptoJS = CryptoJS || (function (Math, undefined) { var C = {}; var C_lib = C.lib = {}; var Base = C_lib.Base = (function () { function F() {}; return { extend: function (overrides) { F.prototype = this; var subtype = new F( ...

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

结帖率:100% (3/3)

签到天数: 12 天

发表于 2020-5-5 13:17:47 | 显示全部楼层   湖北省黄冈市

我计算出来是: 80d381c4a86e51c28b400cb822f0e4a7ed28108570185a5f1f3770fd7de9dc1a

var CryptoJS = CryptoJS || (function (Math, undefined) {
    var C = {};
    var C_lib = C.lib = {};
    var Base = C_lib.Base = (function () {
        function F() {};
        return {
            extend: function (overrides) {
                F.prototype = this;
                var subtype = new F();
                if (overrides) {
                    subtype.mixIn(overrides);
                }
                if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
                    subtype.init = function () {
                        subtype.$super.init.apply(this, arguments);
                    };
                }
                subtype.init.prototype = subtype;
                subtype.$super = this;
                return subtype;
            }, create: function () {
                var instance = this.extend();
                instance.init.apply(instance, arguments);
                return instance;
            }, init: function () {}, mixIn: function (properties) {
                for (var propertyName in properties) {
                    if (properties.hasOwnProperty(propertyName)) {
                        this[propertyName] = properties[propertyName];
                    }
                }
                if (properties.hasOwnProperty('toString')) {
                    this.toString = properties.toString;
                }
            }, clone: function () {
                return this.init.prototype.extend(this);
            }
        };
    }());
    var WordArray = C_lib.WordArray = Base.extend({
        init: function (words, sigBytes) {
            words = this.words = words || [];
            if (sigBytes != undefined) {
                this.sigBytes = sigBytes;
            } else {
                this.sigBytes = words.length * 4;
            }
        }, toString: function (encoder) {
            return (encoder || Hex).stringify(this);
        }, concat: function (wordArray) {
            var thisWords = this.words;
            var thatWords = wordArray.words;
            var thisSigBytes = this.sigBytes;
            var thatSigBytes = wordArray.sigBytes;
            this.clamp();
            if (thisSigBytes % 4) {
                for (var i = 0; i < thatSigBytes; i++) {
                    var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
                    thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
                }
            } else if (thatWords.length > 0xffff) {
                for (var i = 0; i < thatSigBytes; i += 4) {
                    thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
                }
            } else {
                thisWords.push.apply(thisWords, thatWords);
            }
            this.sigBytes += thatSigBytes;
            return this;
        }, clamp: function () {
            var words = this.words;
            var sigBytes = this.sigBytes;
            words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
            words.length = Math.ceil(sigBytes / 4);
        }, clone: function () {
            var clone = Base.clone.call(this);
            clone.words = this.words.slice(0);
            return clone;
        }, random: function (nBytes) {
            var words = [];
            var r = (function (m_w) {
                var m_w = m_w;
                var m_z = 0x3ade68b1;
                var mask = 0xffffffff;
                return function () {
                    m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;
                    m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;
                    var result = ((m_z << 0x10) + m_w) & mask;
                    result /= 0x100000000;
                    result += 0.5;
                    return result * (Math.random() > .5 ? 1 : -1);
                }
            });
            for (var i = 0, rcache; i < nBytes; i += 4) {
                var _r = r((rcache || Math.random()) * 0x100000000);
                rcache = _r() * 0x3ade67b7;
                words.push((_r() * 0x100000000) | 0);
            }
            return new WordArray.init(words, nBytes);
        }
    });
    var C_enc = C.enc = {};
    var Hex = C_enc.Hex = {
        stringify: function (wordArray) {
            var words = wordArray.words;
            var sigBytes = wordArray.sigBytes;
            var hexChars = [];
            for (var i = 0; i < sigBytes; i++) {
                var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
                hexChars.push((bite >>> 4).toString(16));
                hexChars.push((bite & 0x0f).toString(16));
            }
            return hexChars.join('');
        }, parse: function (hexStr) {
            var hexStrLength = hexStr.length;
            var words = [];
            for (var i = 0; i < hexStrLength; i += 2) {
                words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
            }
            return new WordArray.init(words, hexStrLength / 2);
        }
    };
    var Latin1 = C_enc.Latin1 = {
        stringify: function (wordArray) {
            var words = wordArray.words;
            var sigBytes = wordArray.sigBytes;
            var latin1Chars = [];
            for (var i = 0; i < sigBytes; i++) {
                var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
                latin1Chars.push(String.fromCharCode(bite));
            }
            return latin1Chars.join('');
        }, parse: function (latin1Str) {
            var latin1StrLength = latin1Str.length;
            var words = [];
            for (var i = 0; i < latin1StrLength; i++) {
                words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
            }
            return new WordArray.init(words, latin1StrLength);
        }
    };
    var Utf8 = C_enc.Utf8 = {
        stringify: function (wordArray) {
            try {
                return decodeURIComponent(escape(Latin1.stringify(wordArray)));
            } catch (e) {
                throw new Error('Malformed UTF-8 data');
            }
        }, parse: function (utf8Str) {
            return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
        }
    };
    var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
        reset: function () {
            this._data = new WordArray.init();
            this._nDataBytes = 0;
        }, _append: function (data) {
            if (typeof data == 'string') {
                data = Utf8.parse(data);
            }
            this._data.concat(data);
            this._nDataBytes += data.sigBytes;
        }, _process: function (doFlush) {
            var data = this._data;
            var dataWords = data.words;
            var dataSigBytes = data.sigBytes;
            var blockSize = this.blockSize;
            var blockSizeBytes = blockSize * 4;
            var nBlocksReady = dataSigBytes / blockSizeBytes;
            if (doFlush) {
                nBlocksReady = Math.ceil(nBlocksReady);
            } else {
                nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
            }
            var nWordsReady = nBlocksReady * blockSize;
            var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
            if (nWordsReady) {
                for (var offset = 0; offset < nWordsReady; offset += blockSize) {
                    this._doProcessBlock(dataWords, offset);
                }
                var processedWords = dataWords.splice(0, nWordsReady);
                data.sigBytes -= nBytesReady;
            }
            return new WordArray.init(processedWords, nBytesReady);
        }, clone: function () {
            var clone = Base.clone.call(this);
            clone._data = this._data.clone();
            return clone;
        }, _minBufferSize: 0
    });
    var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
        cfg: Base.extend(),
        init: function (cfg) {
            this.cfg = this.cfg.extend(cfg);
            this.reset();
        }, reset: function () {
            BufferedBlockAlgorithm.reset.call(this);
            this._doReset();
        }, update: function (messageUpdate) {
            this._append(messageUpdate);
            this._process();
            return this;
        }, finalize: function (messageUpdate) {
            if (messageUpdate) {
                this._append(messageUpdate);
            }
            var hash = this._doFinalize();
            return hash;
        }, blockSize: 512 / 32,
        _createHelper: function (hasher) {
            return function (message, cfg) {
                return new hasher.init(cfg).finalize(message);
            };
        }, _createHmacHelper: function (hasher) {
            return function (message, key) {
                return new C_algo.HMAC.init(hasher, key).finalize(message);
            };
        }
    });
    var C_algo = C.algo = {};
    return C;
}(Math));

(function () {
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;
    var C_enc = C.enc;
    var Base64 = C_enc.Base64 = {
        stringify: function (wordArray) {
            var words = wordArray.words;
            var sigBytes = wordArray.sigBytes;
            var map = this._map;
            wordArray.clamp();
            var base64Chars = [];
            for (var i = 0; i < sigBytes; i += 3) {
                var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
                var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
                var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
                var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
                for (var j = 0;
                    (j < 4) && (i + j * 0.75 < sigBytes); j++) {
                    base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
                }
            }
            var paddingChar = map.charAt(64);
            if (paddingChar) {
                while (base64Chars.length % 4) {
                    base64Chars.push(paddingChar);
                }
            }
            return base64Chars.join('');
        }, parse: function (base64Str) {
            var base64StrLength = base64Str.length;
            var map = this._map;
            var reverseMap = this._reverseMap;
            if (!reverseMap) {
                reverseMap = this._reverseMap = [];
                for (var j = 0; j < map.length; j++) {
                    reverseMap[map.charCodeAt(j)] = j;
                }
            }
            var paddingChar = map.charAt(64);
            if (paddingChar) {
                var paddingIndex = base64Str.indexOf(paddingChar);
                if (paddingIndex !== -1) {
                    base64StrLength = paddingIndex;
                }
            }
            return parseLoop(base64Str, base64StrLength, reverseMap);
        }, _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
    };
    function parseLoop(base64Str, base64StrLength, reverseMap) {
        var words = [];
        var nBytes = 0;
        for (var i = 0; i < base64StrLength; i++) {
            if (i % 4) {
                var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);
                var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);
                words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);
                nBytes++;
            }
        }
        return WordArray.create(words, nBytes);
    }
}());

(function () {
    var C = CryptoJS;
    var C_lib = C.lib;
    var Base = C_lib.Base;
    var C_enc = C.enc;
    var Utf8 = C_enc.Utf8;
    var C_algo = C.algo;
    var HMAC = C_algo.HMAC = Base.extend({
        init: function (hasher, key) {
            hasher = this._hasher = new hasher.init();
            if (typeof key == 'string') {
                key = Utf8.parse(key);
            }
            var hasherBlockSize = hasher.blockSize;
            var hasherBlockSizeBytes = hasherBlockSize * 4;
            if (key.sigBytes > hasherBlockSizeBytes) {
                key = hasher.finalize(key);
            }
            key.clamp();
            var oKey = this._oKey = key.clone();
            var iKey = this._iKey = key.clone();
            var oKeyWords = oKey.words;
            var iKeyWords = iKey.words;
            for (var i = 0; i < hasherBlockSize; i++) {
                oKeyWords[i] ^= 0x5c5c5c5c;
                iKeyWords[i] ^= 0x36363636;
            }
            oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
            this.reset();
        }, reset: function () {
            var hasher = this._hasher;
            hasher.reset();
            hasher.update(this._iKey);
        }, update: function (messageUpdate) {
            this._hasher.update(messageUpdate);
            return this;
        }, finalize: function (messageUpdate) {
            var hasher = this._hasher;
            var innerHash = hasher.finalize(messageUpdate);
            hasher.reset();
            var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
            return hmac;
        }
    });
}());

(function (Math) {
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;
    var Hasher = C_lib.Hasher;
    var C_algo = C.algo;
    var H = [];
    var K = [];
    (function () {
        function isPrime(n) {
            var sqrtN = Math.sqrt(n);
            for (var factor = 2; factor <= sqrtN; factor++) {
                if (!(n % factor)) {
                    return false;
                }
            }
            return true;
        }
        function getFractionalBits(n) {
            return ((n - (n | 0)) * 0x100000000) | 0;
        }
        var n = 2;
        var nPrime = 0;
        while (nPrime < 64) {
            if (isPrime(n)) {
                if (nPrime < 8) {
                    H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
                }
                K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
                nPrime++;
            }
            n++;
        }
    }());
    var W = [];
    var SHA256 = C_algo.SHA256 = Hasher.extend({
        _doReset: function () {
            this._hash = new WordArray.init(H.slice(0));
        }, _doProcessBlock: function (M, offset) {
            var H = this._hash.words;
            var a = H[0];
            var b = H[1];
            var c = H[2];
            var d = H[3];
            var e = H[4];
            var f = H[5];
            var g = H[6];
            var h = H[7];
            for (var i = 0; i < 64; i++) {
                if (i < 16) {
                    W[i] = M[offset + i] | 0;
                } else {
                    var gamma0x = W[i - 15];
                    var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ ((gamma0x << 14) | (gamma0x >>> 18)) ^ (gamma0x >>> 3);
                    var gamma1x = W[i - 2];
                    var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ ((gamma1x << 13) | (gamma1x >>> 19)) ^ (gamma1x >>> 10);
                    W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
                }
                var ch = (e & f) ^ (~e & g);
                var maj = (a & b) ^ (a & c) ^ (b & c);
                var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
                var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
                var t1 = h + sigma1 + ch + K[i] + W[i];
                var t2 = sigma0 + maj;
                h = g;
                g = f;
                f = e;
                e = (d + t1) | 0;
                d = c;
                c = b;
                b = a;
                a = (t1 + t2) | 0;
            }
            H[0] = (H[0] + a) | 0;
            H[1] = (H[1] + b) | 0;
            H[2] = (H[2] + c) | 0;
            H[3] = (H[3] + d) | 0;
            H[4] = (H[4] + e) | 0;
            H[5] = (H[5] + f) | 0;
            H[6] = (H[6] + g) | 0;
            H[7] = (H[7] + h) | 0;
        }, _doFinalize: function () {
            var data = this._data;
            var dataWords = data.words;
            var nBitsTotal = this._nDataBytes * 8;
            var nBitsLeft = data.sigBytes * 8;
            dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
            data.sigBytes = dataWords.length * 4;
            this._process();
            return this._hash;
        }, clone: function () {
            var clone = Hasher.clone.call(this);
            clone._hash = this._hash.clone();
            return clone;
        }
    });
    C.SHA256 = Hasher._createHelper(SHA256);
    C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
}(Math));

function HmacSHA256_Encrypt(word, key) {
    return CryptoJS.HmacSHA256(word, key).toString(CryptoJS.enc.Hex);
}

function test(){
    var u = "80TD9QXUGHOEZLkcmB5h3uSpWvqNlfoM"
    var a = "1588654931"
    var l = '{"password":"123456","phone":"15885886622"}';
    return HmacSHA256_Encrypt(l + "." + a, u);
}

评分

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

查看全部评分

回复

使用道具 举报

结帖率:91% (58/64)

签到天数: 4 天

发表于 2020-5-5 15:29:30 高大上手机用户 | 显示全部楼层   江苏省徐州市
Heisenberg 发表于 2020-5-5 14:25
[md]我计算出来是: 80d381c4a86e51c28b400cb822f0e4a7ed28108570185a5f1f3770fd7de9dc1a

```JavaScrip ...

我一直在怀疑我是错的哈哈  
回复

使用道具 举报

结帖率:0% (0/1)
发表于 2020-5-8 14:42:54 | 显示全部楼层   山东省济宁市
我一直在怀疑我是错的哈哈  
回复

使用道具 举报

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

本版积分规则 致发广告者

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

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

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