毒 sign

var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var get_00d8 = {
rotl: function(t, e) {
    return t << e | t >>> 32 - e
},
rotr: function(t, e) {
    return t << 32 - e | t >>> e
},
endian: function(t) {
    if (t.constructor == Number) return 16711935 & get_00d8.rotl(t, 8) | 4278255360 & get_00d8.rotl(t, 24);
    for (var e = 0; e < t.length; e++) t[e] = get_00d8.endian(t[e]);
    return t
},
randomBytes: function(t) {
    for (var e = []; t > 0; t--) e.push(Math.floor(256 * Math.random()));
    return e
},
bytesToWords: function(t) {
    for (var e = [], n = 0, r = 0; n < t.length; n++, r += 8) e[r >>> 5] |= t[n] << 24 - r % 32;
    return e
},
wordsToBytes: function(t) {
    for (var e = [], n = 0; n < 32 * t.length; n += 8) e.push(t[n >>> 5] >>> 24 - n % 32 & 255);
    return e
},
bytesToHex: function(t) {
    for (var e = [], n = 0; n < t.length; n++) e.push((t[n] >>> 4).toString(16)),
    e.push((15 & t[n]).toString(16));
    return e.join("")
},
hexToBytes: function(t) {
    for (var e = [], n = 0; n < t.length; n += 2) e.push(parseInt(t.substr(n, 2), 16));
    return e
},
bytesToBase64: function(t) {
    for (var n = [], r = 0; r < t.length; r += 3) for (var o = t[r] << 16 | t[r + 1] << 8 | t[r + 2], i = 0; i < 4; i++) 8 * r + 6 * i <= 8 * t.length ? n.push(e.charAt(o >>> 6 * (3 - i) & 63)) : n.push("=");
    return n.join("")
},
base64ToBytes: function(t) {
    t = t.replace(/[^A-Z0-9+\/]/gi, "");
    for (var n = [], r = 0, o = 0; r < t.length; o = ++r % 4) 0 != o && n.push((e.indexOf(t.charAt(r - 1)) & Math.pow(2, -2 * o + 8) - 1) << 2 * o | e.indexOf(t.charAt(r)) >>> 6 - 2 * o);
    return n
}
};

function get_044b(t, e) {
function n(t) {
    return !! t.constructor && "function" === typeof t.constructor.isBuffer && t.constructor.isBuffer(t)
}
function r(t) {
    return "function" === typeof t.readFloatLE && "function" === typeof t.slice && n(t.slice(0, 0))
}
t.exports = function(t) {
    return null != t && (n(t) || r(t) || !!t._isBuffer)
}
};
var get_9a63 = {
utf8: {
    stringToBytes: function(t) {
        return get_9a63.bin.stringToBytes(unescape(encodeURIComponent(t)))
    },
    bytesToString: function(t) {
        return decodeURIComponent(escape(n.bin.bytesToString(t)))
    }
},
bin: {
    stringToBytes: function(t) {
        for (var e = [], n = 0; n < t.length; n++) e.push(255 & t.charCodeAt(n));
        return e
    },
    bytesToString: function(t) {
        for (var e = [], n = 0; n < t.length; n++) e.push(String.fromCharCode(t[n]));
        return e.join("")
    }
}
};

function get_sign(t, e, n) {
var e = get_00d8;
r = get_9a63.utf8;
o = get_044b;
i = get_9a63.bin;
a = function(t, n) {
    t.constructor == String ? t = n && "binary" === n.encoding ? i.stringToBytes(t) : r.stringToBytes(t) : o(t) ? t = Array.prototype.slice.call(t, 0) : Array.isArray(t) || (t = t.toString());
    for (var u = e.bytesToWords(t), s = 8 * t.length, c = 1732584193, f = -271733879, p = -1732584194, l = 271733878, d = 0; d < u.length; d++) u[d] = 16711935 & (u[d] << 8 | u[d] >>> 24) | 4278255360 & (u[d] << 24 | u[d] >>> 8);
    u[s >>> 5] |= 128 << s % 32,
    u[14 + (s + 64 >>> 9 << 4)] = s;
    var h = a._ff,
    g = a._gg,
    m = a._hh,
    y = a._ii;
    for (d = 0; d < u.length; d += 16) {
        var v = c,
        b = f,
        w = p,
        x = l;
        c = h(c, f, p, l, u[d + 0], 7, -680876936),
        l = h(l, c, f, p, u[d + 1], 12, -389564586),
        p = h(p, l, c, f, u[d + 2], 17, 606105819),
        f = h(f, p, l, c, u[d + 3], 22, -1044525330),
        c = h(c, f, p, l, u[d + 4], 7, -176418897),
        l = h(l, c, f, p, u[d + 5], 12, 1200080426),
        p = h(p, l, c, f, u[d + 6], 17, -1473231341),
        f = h(f, p, l, c, u[d + 7], 22, -45705983),
        c = h(c, f, p, l, u[d + 8], 7, 1770035416),
        l = h(l, c, f, p, u[d + 9], 12, -1958414417),
        p = h(p, l, c, f, u[d + 10], 17, -42063),
        f = h(f, p, l, c, u[d + 11], 22, -1990404162),
        c = h(c, f, p, l, u[d + 12], 7, 1804603682),
        l = h(l, c, f, p, u[d + 13], 12, -40341101),
        p = h(p, l, c, f, u[d + 14], 17, -1502002290),
        f = h(f, p, l, c, u[d + 15], 22, 1236535329),
        c = g(c, f, p, l, u[d + 1], 5, -165796510),
        l = g(l, c, f, p, u[d + 6], 9, -1069501632),
        p = g(p, l, c, f, u[d + 11], 14, 643717713),
        f = g(f, p, l, c, u[d + 0], 20, -373897302),
        c = g(c, f, p, l, u[d + 5], 5, -701558691),
        l = g(l, c, f, p, u[d + 10], 9, 38016083),
        p = g(p, l, c, f, u[d + 15], 14, -660478335),
        f = g(f, p, l, c, u[d + 4], 20, -405537848),
        c = g(c, f, p, l, u[d + 9], 5, 568446438),
        l = g(l, c, f, p, u[d + 14], 9, -1019803690),
        p = g(p, l, c, f, u[d + 3], 14, -187363961),
        f = g(f, p, l, c, u[d + 8], 20, 1163531501),
        c = g(c, f, p, l, u[d + 13], 5, -1444681467),
        l = g(l, c, f, p, u[d + 2], 9, -51403784),
        p = g(p, l, c, f, u[d + 7], 14, 1735328473),
        f = g(f, p, l, c, u[d + 12], 20, -1926607734),
        c = m(c, f, p, l, u[d + 5], 4, -378558),
        l = m(l, c, f, p, u[d + 8], 11, -2022574463),
        p = m(p, l, c, f, u[d + 11], 16, 1839030562),
        f = m(f, p, l, c, u[d + 14], 23, -35309556),
        c = m(c, f, p, l, u[d + 1], 4, -1530992060),
        l = m(l, c, f, p, u[d + 4], 11, 1272893353),
        p = m(p, l, c, f, u[d + 7], 16, -155497632),
        f = m(f, p, l, c, u[d + 10], 23, -1094730640),
        c = m(c, f, p, l, u[d + 13], 4, 681279174),
        l = m(l, c, f, p, u[d + 0], 11, -358537222),
        p = m(p, l, c, f, u[d + 3], 16, -722521979),
        f = m(f, p, l, c, u[d + 6], 23, 76029189),
        c = m(c, f, p, l, u[d + 9], 4, -640364487),
        l = m(l, c, f, p, u[d + 12], 11, -421815835),
        p = m(p, l, c, f, u[d + 15], 16, 530742520),
        f = m(f, p, l, c, u[d + 2], 23, -995338651),
        c = y(c, f, p, l, u[d + 0], 6, -198630844),
        l = y(l, c, f, p, u[d + 7], 10, 1126891415),
        p = y(p, l, c, f, u[d + 14], 15, -1416354905),
        f = y(f, p, l, c, u[d + 5], 21, -57434055),
        c = y(c, f, p, l, u[d + 12], 6, 1700485571),
        l = y(l, c, f, p, u[d + 3], 10, -1894986606),
        p = y(p, l, c, f, u[d + 10], 15, -1051523),
        f = y(f, p, l, c, u[d + 1], 21, -2054922799),
        c = y(c, f, p, l, u[d + 8], 6, 1873313359),
        l = y(l, c, f, p, u[d + 15], 10, -30611744),
        p = y(p, l, c, f, u[d + 6], 15, -1560198380),
        f = y(f, p, l, c, u[d + 13], 21, 1309151649),
        c = y(c, f, p, l, u[d + 4], 6, -145523070),
        l = y(l, c, f, p, u[d + 11], 10, -1120210379),
        p = y(p, l, c, f, u[d + 2], 15, 718787259),
        f = y(f, p, l, c, u[d + 9], 21, -343485551),
        c = c + v >>> 0,
        f = f + b >>> 0,
        p = p + w >>> 0,
        l = l + x >>> 0
    }
    return e.endian([c, f, p, l])
};
a._ff = function(t, e, n, r, o, i, a) {
    var u = t + (e & n | ~e & r) + (o >>> 0) + a;
    return (u << i | u >>> 32 - i) + e
},
a._gg = function(t, e, n, r, o, i, a) {
    var u = t + (e & r | n & ~r) + (o >>> 0) + a;
    return (u << i | u >>> 32 - i) + e
},
a._hh = function(t, e, n, r, o, i, a) {
    var u = t + (e ^ n ^ r) + (o >>> 0) + a;
    return (u << i | u >>> 32 - i) + e
},
a._ii = function(t, e, n, r, o, i, a) {
    var u = t + (n ^ (e | ~r)) + (o >>> 0) + a;
    return (u << i | u >>> 32 - i) + e
},
a._blocksize = 16,
a._digestsize = 16;
var r = e.wordsToBytes(a(t, n));
var result = e.bytesToHex(r);
return result
}

调用:get_sign('trendId24080080048a9c4943398714b356a696503d2d36')

 

笨办法:主要在于修改js,使它能够跑通,摘出来关键代码后,可以本地一边修改一边运行测试,报错提示啥,按提示进行修改

 

如有侵权,还请麻烦通知我删除

posted @ 2019-10-22 16:50  殇夜00  阅读(15)  评论(0)    收藏  举报