某狗网翻译接口逆向之webpack扣取

news2024/12/26 15:33:40
​​​​​逆向网址
aHR0cHM6Ly9mYW55aS5zb2dvdS5jb20=

逆向链接
aHR0cHM6Ly9mYW55aS5zb2dvdS5jb20vdGV4dA==

 逆向接口
aHR0cHM6Ly9mYW55aS5zb2dvdS5jb20vYXBpL3RyYW5zcGMvdGV4dC9yZXN1bHQ=

逆向过程
请求方式:POST
参数构成:

        【s】  1b921dbefaa8d939afca4068480f850d

       【uuid】 1b077a29-1784-4883-9199-864e5e75e73e

根据断点可快速进入发包内容

        XHR 方断点方式进入【app.54dc9d73.js】

I数据组为HTTP请求发包内容。

那么由此可以得到我们想到的参数:【uuid】 => T,【s】 => D

 

T = x.uuid || Y.a.get(),
C = x.secretCode || "",
D = V.a.cal("".concat(p).concat(m).concat(l).concat(C)),

扣取代码
webpack

拉到文件最顶部可知是 WebPack 方式

构建加载器

加载器关键词

t[e].call(n.exports, n, n.exports, c),

上图断点断住后,控制台处输出【V.a.cal】 点击底部输出结果可直接跳转至函数定义处

向上找函数 【r】 处打断点进入加载器模块

!function(t) {
    function e(e) {
        for (var r, o, c = e[0], u = e[1], s = e[2], d = 0, l = []; d < c.length; d++)
            o = c[d],
            Object.prototype.hasOwnProperty.call(a, o) && a[o] && l.push(a[o][0]),
            a[o] = 0;
        for (r in u)
            Object.prototype.hasOwnProperty.call(u, r) && (t[r] = u[r]);
        for (f && f(e); l.length; )
            l.shift()();
        return i.push.apply(i, s || []),
        n()
    }
    function n() {
        for (var t, e = 0; e < i.length; e++) {
            for (var n = i[e], r = !0, o = 1; o < n.length; o++) {
                var u = n[o];
                0 !== a[u] && (r = !1)
            }
            r && (i.splice(e--, 1),
            t = c(c.s = n[0]))
        }
        return t
    }
    var r = {}
      , o = {
        "2": 0
    }
      , a = {
        "2": 0
    }
      , i = [];
    function c(e) {
        if (r[e])
            return r[e].exports;
        var n = r[e] = {
            "i": e,
            "l": !1,
            "exports": {}
        };
        return t[e].call(n.exports, n, n.exports, c),
        n.l = !0,
        n.exports
    }
    c.e = function(t) {
        var e = [];
        o[t] ? e.push(o[t]) : 0 !== o[t] && {
            "0": 1,
            "3": 1,
            "5": 1,
            "6": 1,
            "8": 1,
            "9": 1,
            "10": 1,
            "12": 1,
            "13": 1,
            "14": 1,
            "16": 1,
            "17": 1
        }[t] && e.push(o[t] = new Promise((function(e, n) {
            for (var r = "pc/static/css/" + t + "." + {
                "0": "3382dd17",
                "1": "31d6cfe0",
                "3": "e674dfb6",
                "4": "31d6cfe0",
                "5": "8106975a",
                "6": "84b33b37",
                "7": "31d6cfe0",
                "8": "c1092e98",
                "9": "29fc9c62",
                "10": "b2b74c09",
                "12": "7a0342b5",
                "13": "8956a5e0",
                "14": "0e433876",
                "15": "31d6cfe0",
                "16": "9d6461c8",
                "17": "a9dcb4cf"
            }[t] + ".css", a = c.p + r, i = document.getElementsByTagName("link"), u = 0; u < i.length; u++) {
                var s = (f = i[u]).getAttribute("data-href") || f.getAttribute("href");
                if ("stylesheet" === f.rel && (s === r || s === a))
                    return e()
            }
            var d = document.getElementsByTagName("style");
            for (u = 0; u < d.length; u++) {
                var f;
                if ((s = (f = d[u]).getAttribute("data-href")) === r || s === a)
                    return e()
            }
            var l = document.createElement("link");
            l.rel = "stylesheet",
            l.type = "text/css",
            l.onload = e,
            l.onerror = function(e) {
                var r = e && e.target && e.target.src || a
                  , i = new Error("Loading CSS chunk " + t + " failed.\n(" + r + ")");
                i.request = r,
                delete o[t],
                l.parentNode.removeChild(l),
                n(i)
            }
            ,
            l.href = a,
            0 !== l.href.indexOf(window.location.origin + "/") && (l.crossOrigin = "anonymous"),
            document.getElementsByTagName("head")[0].appendChild(l)
        }
        )).then((function() {
            o[t] = 0
        }
        )));
        var n = a[t];
        if (0 !== n)
            if (n)
                e.push(n[2]);
            else {
                var r = new Promise((function(e, r) {
                    n = a[t] = [e, r]
                }
                ));
                e.push(n[2] = r);
                var i, u = document.createElement("script");
                u.charset = "utf-8",
                u.timeout = 120,
                c.nc && u.setAttribute("nonce", c.nc),
                u.src = function(t) {
                    return c.p + "pc/static/js/" + ({
                        "0": "common",
                        "3": "docpreview",
                        "4": "document",
                        "5": "favorite",
                        "6": "home",
                        "7": "picture",
                        "8": "privacyPC",
                        "9": "tencentDocPreview",
                        "10": "text",
                        "12": "wapDocPreview",
                        "13": "website",
                        "14": "writing"
                    }[t] || t) + "." + {
                        "0": "ae225113",
                        "1": "89746696",
                        "3": "a33f9731",
                        "4": "cc2950ec",
                        "5": "04bbcfe8",
                        "6": "0cdb454f",
                        "7": "d6c066b4",
                        "8": "77130bfc",
                        "9": "2129d1a7",
                        "10": "40f90d84",
                        "12": "317c78cb",
                        "13": "61ef5ce0",
                        "14": "1562e6de",
                        "15": "21ad6f3f",
                        "16": "928f55ad",
                        "17": "ceaacc2c"
                    }[t] + ".js"
                }(t),
                0 !== u.src.indexOf(window.location.origin + "/") && (u.crossOrigin = "anonymous");
                var s = new Error;
                i = function(e) {
                    u.onerror = u.onload = null,
                    clearTimeout(d);
                    var n = a[t];
                    if (0 !== n) {
                        if (n) {
                            var r = e && ("load" === e.type ? "missing" : e.type)
                              , o = e && e.target && e.target.src;
                            s.message = "Loading chunk " + t + " failed.\n(" + r + ": " + o + ")",
                            s.name = "ChunkLoadError",
                            s.type = r,
                            s.request = o,
                            n[1](s)
                        }
                        a[t] = void 0
                    }
                }
                ;
                var d = setTimeout((function() {
                    i({
                        "type": "timeout",
                        "target": u
                    })
                }
                ), 12e4);
                u.onerror = u.onload = i,
                document.head.appendChild(u)
            }
        return Promise.all(e)
    }
    ,
    c.m = t,
    c.c = r,
    c.d = function(t, e, n) {
        c.o(t, e) || Object.defineProperty(t, e, {
            "enumerable": !0,
            "get": n
        })
    }
    ,
    c.r = function(t) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
            "value": "Module"
        }),
        Object.defineProperty(t, "__esModule", {
            "value": !0
        })
    }
    ,
    c.t = function(t, e) {
        if (1 & e && (t = c(t)),
        8 & e)
            return t;
        if (4 & e && "object" == typeof t && t && t.__esModule)
            return t;
        var n = Object.create(null);
        if (c.r(n),
        Object.defineProperty(n, "default", {
            "enumerable": !0,
            "value": t
        }),
        2 & e && "string" != typeof t)
            for (var r in t)
                c.d(n, r, function(e) {
                    return t[e]
                }
                .bind(null, r));
        return n
    }
    ,
    c.n = function(t) {
        var e = t && t.__esModule ? function() {
            return t.default
        }
        : function() {
            return t
        }
        ;
        return c.d(e, "a", e),
        e
    }
    ,
    c.o = function(t, e) {
        return Object.prototype.hasOwnProperty.call(t, e)
    }
    ,
    c.p = "//search.sogoucdn.com/translate/",
    c.oe = function(t) {
        throw t
    }
    ;
    var u = window.webpackJsonp = window.webpackJsonp || []
      , s = u.push.bind(u);
    u.push = e,
    u = u.slice();
    for (var d = 0; d < u.length; d++)
        e(u[d]);
    var f = s;
    i.push([358, 11]),
    n()
}()

重新构建将加载器函数导出即可使用

那么到这里基本就结束了。
只需将上面webpack适配下 即可实现扣代码模块

var _util;
!function(t) {
    function e(e) {
        for (var r, o, c = e[0], u = e[1], s = e[2], d = 0, l = []; d < c.length; d++)
            o = c[d],
            Object.prototype.hasOwnProperty.call(a, o) && a[o] && l.push(a[o][0]),
            a[o] = 0;
        for (r in u)
            Object.prototype.hasOwnProperty.call(u, r) && (t[r] = u[r]);
        for (f && f(e); l.length; )
            l.shift()();
        return i.push.apply(i, s || []),
        n()
    }
    function n() {
        for (var t, e = 0; e < i.length; e++) {
            for (var n = i[e], r = !0, o = 1; o < n.length; o++) {
                var u = n[o];
                0 !== a[u] && (r = !1)
            }
            r && (i.splice(e--, 1),
            t = c(c.s = n[0]))
        }
        return t
    }
    var r = {}
      , o = {
        "2": 0
    }
      , a = {
        "2": 0
    }
      , i = [];
    function c(e) {
        if (r[e])
            return r[e].exports;
        var n = r[e] = {
            "i": e,
            "l": !1,
            "exports": {}
        };
        return t[e].call(n.exports, n, n.exports, c),
        n.l = !0,
        n.exports

    }
    c.e = function(t) {
        var e = [];
        o[t] ? e.push(o[t]) : 0 !== o[t] && {
            "0": 1,
            "3": 1,
            "5": 1,
            "6": 1,
            "8": 1,
            "9": 1,
            "10": 1,
            "12": 1,
            "13": 1,
            "14": 1,
            "16": 1,
            "17": 1
        }[t] && e.push(o[t] = new Promise((function(e, n) {
            for (var r = "pc/static/css/" + t + "." + {
                "0": "3382dd17",
                "1": "31d6cfe0",
                "3": "e674dfb6",
                "4": "31d6cfe0",
                "5": "8106975a",
                "6": "84b33b37",
                "7": "31d6cfe0",
                "8": "c1092e98",
                "9": "29fc9c62",
                "10": "b2b74c09",
                "12": "7a0342b5",
                "13": "8956a5e0",
                "14": "0e433876",
                "15": "31d6cfe0",
                "16": "9d6461c8",
                "17": "a9dcb4cf"
            }[t] + ".css", a = c.p + r, i = document.getElementsByTagName("link"), u = 0; u < i.length; u++) {
                var s = (f = i[u]).getAttribute("data-href") || f.getAttribute("href");
                if ("stylesheet" === f.rel && (s === r || s === a))
                    return e()
            }
            var d = document.getElementsByTagName("style");
            for (u = 0; u < d.length; u++) {
                var f;
                if ((s = (f = d[u]).getAttribute("data-href")) === r || s === a)
                    return e()
            }
            var l = document.createElement("link");
            l.rel = "stylesheet",
            l.type = "text/css",
            l.onload = e,
            l.onerror = function(e) {
                var r = e && e.target && e.target.src || a
                  , i = new Error("Loading CSS chunk " + t + " failed.\n(" + r + ")");
                i.request = r,
                delete o[t],
                l.parentNode.removeChild(l),
                n(i)
            }
            ,
            l.href = a,
            0 !== l.href.indexOf(window.location.origin + "/") && (l.crossOrigin = "anonymous"),
            document.getElementsByTagName("head")[0].appendChild(l)
        }
        )).then((function() {
            o[t] = 0
        }
        )));
        var n = a[t];
        if (0 !== n)
            if (n)
                e.push(n[2]);
            else {
                var r = new Promise((function(e, r) {
                    n = a[t] = [e, r]
                }
                ));
                e.push(n[2] = r);
                var i, u = document.createElement("script");
                u.charset = "utf-8",
                u.timeout = 120,
                c.nc && u.setAttribute("nonce", c.nc),
                u.src = function(t) {
                    return c.p + "pc/static/js/" + ({
                        "0": "common",
                        "3": "docpreview",
                        "4": "document",
                        "5": "favorite",
                        "6": "home",
                        "7": "picture",
                        "8": "privacyPC",
                        "9": "tencentDocPreview",
                        "10": "text",
                        "12": "wapDocPreview",
                        "13": "website",
                        "14": "writing"
                    }[t] || t) + "." + {
                        "0": "ae225113",
                        "1": "89746696",
                        "3": "a33f9731",
                        "4": "cc2950ec",
                        "5": "04bbcfe8",
                        "6": "0cdb454f",
                        "7": "d6c066b4",
                        "8": "77130bfc",
                        "9": "2129d1a7",
                        "10": "40f90d84",
                        "12": "317c78cb",
                        "13": "61ef5ce0",
                        "14": "1562e6de",
                        "15": "21ad6f3f",
                        "16": "928f55ad",
                        "17": "ceaacc2c"
                    }[t] + ".js"
                }(t),
                0 !== u.src.indexOf(window.location.origin + "/") && (u.crossOrigin = "anonymous");
                var s = new Error;
                i = function(e) {
                    u.onerror = u.onload = null,
                    clearTimeout(d);
                    var n = a[t];
                    if (0 !== n) {
                        if (n) {
                            var r = e && ("load" === e.type ? "missing" : e.type)
                              , o = e && e.target && e.target.src;
                            s.message = "Loading chunk " + t + " failed.\n(" + r + ": " + o + ")",
                            s.name = "ChunkLoadError",
                            s.type = r,
                            s.request = o,
                            n[1](s)
                        }
                        a[t] = void 0
                    }
                }
                ;
                var d = setTimeout((function() {
                    i({
                        "type": "timeout",
                        "target": u
                    })
                }
                ), 12e4);
                u.onerror = u.onload = i,
                document.head.appendChild(u)
            }
        return Promise.all(e)
    }
    ,
    c.m = t,
    c.c = r,
    c.d = function(t, e, n) {
        c.o(t, e) || Object.defineProperty(t, e, {
            "enumerable": !0,
            "get": n
        })
    }
    ,
    c.r = function(t) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
            "value": "Module"
        }),
        Object.defineProperty(t, "__esModule", {
            "value": !0
        })
    }
    ,
    c.t = function(t, e) {
        if (1 & e && (t = c(t)),
        8 & e)
            return t;
        if (4 & e && "object" == typeof t && t && t.__esModule)
            return t;
        var n = Object.create(null);
        if (c.r(n),
        Object.defineProperty(n, "default", {
            "enumerable": !0,
            "value": t
        }),
        2 & e && "string" != typeof t)
            for (var r in t)
                c.d(n, r, function(e) {
                    return t[e]
                }
                .bind(null, r));
        return n
    }
    ,
    c.n = function(t) {
        var e = t && t.__esModule ? function() {
            return t.default
        }
        : function() {
            return t
        }
        ;
        return c.d(e, "a", e),
        e
    }
    ,
    c.o = function(t, e) {
        return Object.prototype.hasOwnProperty.call(t, e)
    }
    ,
    c.p = "//search.sogoucdn.com/translate/",
    c.oe = function(t) {
        throw t
    }
    ;
    var u = window.webpackJsonp = window.webpackJsonp || []
      , s = u.push.bind(u);
    u.push = e,
    u = u.slice();
    for (var d = 0; d < u.length; d++)
        e(u[d]);
    var f = s;
    i.push([358, 11]),
    _util = c;
}([
    function(t, n, r) {
        var e;
        e = ()=>({
            "cond"() {
                const t = _util(2)
                  , {"utf8": n} = _util(1)
                  , e = _util(3)
                  , {"bin": o} = _util(1);
                return {
                    "crypt": t,
                    "utf8": n,
                    "isBuffer": e,
                    "bin": o
                }
            },
            "md5"(t, n) {
                t.constructor == String ? t = n && "binary" === n.encoding ? this.cond().bin.stringToBytes(t) : this.cond().utf8.stringToBytes(t) : this.cond().isBuffer(t) ? t = Array.prototype.slice.call(t, 0) : Array.isArray(t) || (t = t.toString());
                const r = this.cond().crypt.bytesToWords(t)
                  , e = 8 * t.length;
                let o = 1732584193
                  , i = -271733879
                  , u = -1732584194
                  , a = 271733878;
                for (var c = 0; c < r.length; c++)
                    r[c] = 16711935 & (r[c] << 8 | r[c] >>> 24) | 4278255360 & (r[c] << 24 | r[c] >>> 8);
                r[e >>> 5] |= 128 << e % 32,
                r[14 + (e + 64 >>> 9 << 4)] = e;
                const f = this._ff
                  , s = this._gg
                  , l = this._hh
                  , h = this._ii;
                for (c = 0; c < r.length; c += 16) {
                    const t = o
                      , n = i
                      , e = u
                      , p = a;
                    o = f(o, i, u, a, r[c + 0], 7, -680876936),
                    a = f(a, o, i, u, r[c + 1], 12, -389564586),
                    u = f(u, a, o, i, r[c + 2], 17, 606105819),
                    i = f(i, u, a, o, r[c + 3], 22, -1044525330),
                    o = f(o, i, u, a, r[c + 4], 7, -176418897),
                    a = f(a, o, i, u, r[c + 5], 12, 1200080426),
                    u = f(u, a, o, i, r[c + 6], 17, -1473231341),
                    i = f(i, u, a, o, r[c + 7], 22, -45705983),
                    o = f(o, i, u, a, r[c + 8], 7, 1770035416),
                    a = f(a, o, i, u, r[c + 9], 12, -1958414417),
                    u = f(u, a, o, i, r[c + 10], 17, -42063),
                    i = f(i, u, a, o, r[c + 11], 22, -1990404162),
                    o = f(o, i, u, a, r[c + 12], 7, 1804603682),
                    a = f(a, o, i, u, r[c + 13], 12, -40341101),
                    u = f(u, a, o, i, r[c + 14], 17, -1502002290),
                    i = f(i, u, a, o, r[c + 15], 22, 1236535329),
                    o = s(o, i, u, a, r[c + 1], 5, -165796510),
                    a = s(a, o, i, u, r[c + 6], 9, -1069501632),
                    u = s(u, a, o, i, r[c + 11], 14, 643717713),
                    i = s(i, u, a, o, r[c + 0], 20, -373897302),
                    o = s(o, i, u, a, r[c + 5], 5, -701558691),
                    a = s(a, o, i, u, r[c + 10], 9, 38016083),
                    u = s(u, a, o, i, r[c + 15], 14, -660478335),
                    i = s(i, u, a, o, r[c + 4], 20, -405537848),
                    o = s(o, i, u, a, r[c + 9], 5, 568446438),
                    a = s(a, o, i, u, r[c + 14], 9, -1019803690),
                    u = s(u, a, o, i, r[c + 3], 14, -187363961),
                    i = s(i, u, a, o, r[c + 8], 20, 1163531501),
                    o = s(o, i, u, a, r[c + 13], 5, -1444681467),
                    a = s(a, o, i, u, r[c + 2], 9, -51403784),
                    u = s(u, a, o, i, r[c + 7], 14, 1735328473),
                    i = s(i, u, a, o, r[c + 12], 20, -1926607734),
                    o = l(o, i, u, a, r[c + 5], 4, -378558),
                    a = l(a, o, i, u, r[c + 8], 11, -2022574463),
                    u = l(u, a, o, i, r[c + 11], 16, 1839030562),
                    i = l(i, u, a, o, r[c + 14], 23, -35309556),
                    o = l(o, i, u, a, r[c + 1], 4, -1530992060),
                    a = l(a, o, i, u, r[c + 4], 11, 1272893353),
                    u = l(u, a, o, i, r[c + 7], 16, -155497632),
                    i = l(i, u, a, o, r[c + 10], 23, -1094730640),
                    o = l(o, i, u, a, r[c + 13], 4, 681279174),
                    a = l(a, o, i, u, r[c + 0], 11, -358537222),
                    u = l(u, a, o, i, r[c + 3], 16, -722521979),
                    i = l(i, u, a, o, r[c + 6], 23, 76029189),
                    o = l(o, i, u, a, r[c + 9], 4, -640364487),
                    a = l(a, o, i, u, r[c + 12], 11, -421815835),
                    u = l(u, a, o, i, r[c + 15], 16, 530742520),
                    i = l(i, u, a, o, r[c + 2], 23, -995338651),
                    o = h(o, i, u, a, r[c + 0], 6, -198630844),
                    a = h(a, o, i, u, r[c + 7], 10, 1126891415),
                    u = h(u, a, o, i, r[c + 14], 15, -1416354905),
                    i = h(i, u, a, o, r[c + 5], 21, -57434055),
                    o = h(o, i, u, a, r[c + 12], 6, 1700485571),
                    a = h(a, o, i, u, r[c + 3], 10, -1894986606),
                    u = h(u, a, o, i, r[c + 10], 15, -1051523),
                    i = h(i, u, a, o, r[c + 1], 21, -2054922799),
                    o = h(o, i, u, a, r[c + 8], 6, 1873313359),
                    a = h(a, o, i, u, r[c + 15], 10, -30611744),
                    u = h(u, a, o, i, r[c + 6], 15, -1560198380),
                    i = h(i, u, a, o, r[c + 13], 21, 1309151649),
                    o = h(o, i, u, a, r[c + 4], 6, -145523070),
                    a = h(a, o, i, u, r[c + 11], 10, -1120210379),
                    u = h(u, a, o, i, r[c + 2], 15, 718787259),
                    i = h(i, u, a, o, r[c + 9], 21, -343485551),
                    o = o + t >>> 0,
                    i = i + n >>> 0,
                    u = u + e >>> 0,
                    a = a + p >>> 0
                }
                return this.cond().crypt.endian([o, i, u, a])
            },
            "_ff"(t, n, r, e, o, i, u) {
                const a = t + (n & r | ~n & e) + (o >>> 0) + u;
                return (a << i | a >>> 32 - i) + n
            },
            "_gg"(t, n, r, e, o, i, u) {
                const a = t + (n & e | r & ~e) + (o >>> 0) + u;
                return (a << i | a >>> 32 - i) + n
            },
            "_hh"(t, n, r, e, o, i, u) {
                const a = t + (n ^ r ^ e) + (o >>> 0) + u;
                return (a << i | a >>> 32 - i) + n
            },
            "_ii"(t, n, r, e, o, i, u) {
                const a = t + (r ^ (n | ~e)) + (o >>> 0) + u;
                return (a << i | a >>> 32 - i) + n
            },
            "_blocksize": 16,
            "_digestsize": 16,
            "cal"(t, n) {
                if (null == t)
                    throw new Error(`Illegal argument ${t}`);
                const r = this.cond().crypt.wordsToBytes(this.md5(t, n));
                return n && n.asBytes ? r : n && n.asString ? this.cond().bin.bytesToString(r) : this.cond().crypt.bytesToHex(r)
            }
        }),
        t.exports = e()
    },
    function(t, n) {
    var r = {
        "utf8": {
            "stringToBytes": t=>r.bin.stringToBytes(unescape(encodeURIComponent(t))),
            "bytesToString": t=>decodeURIComponent(escape(r.bin.bytesToString(t)))
        },
        "bin": {
            "stringToBytes"(t) {
                for (var n = [], r = 0; r < t.length; r++)
                    n.push(255 & t.charCodeAt(r));
                return n
            },
            "bytesToString"(t) {
                for (var n = [], r = 0; r < t.length; r++)
                    n.push(String.fromCharCode(t[r]));
                return n.join("")
            }
        }
    };
    t.exports = r
},
    function(t, n) {
    !function() {
        const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
        var r = {
            "rotl": (t,n)=>t << n | t >>> 32 - n,
            "rotr": (t,n)=>t << 32 - n | t >>> n,
            "endian"(t) {
                if (t.constructor == Number)
                    return 16711935 & r.rotl(t, 8) | 4278255360 & r.rotl(t, 24);
                for (let n = 0; n < t.length; n++)
                    t[n] = r.endian(t[n]);
                return t
            },
            "randomBytes"(t) {
                for (var n = []; t > 0; t--)
                    n.push(Math.floor(256 * Math.random()));
                return n
            },
            "bytesToWords"(t) {
                for (var n = [], r = 0, e = 0; r < t.length; r++,
                e += 8)
                    n[e >>> 5] |= t[r] << 24 - e % 32;
                return n
            },
            "wordsToBytes"(t) {
                for (var n = [], r = 0; r < 32 * t.length; r += 8)
                    n.push(t[r >>> 5] >>> 24 - r % 32 & 255);
                return n
            },
            "bytesToHex"(t) {
                for (var n = [], r = 0; r < t.length; r++)
                    n.push((t[r] >>> 4).toString(16)),
                    n.push((15 & t[r]).toString(16));
                return n.join("")
            },
            "hexToBytes"(t) {
                for (var n = [], r = 0; r < t.length; r += 2)
                    n.push(parseInt(t.substr(r, 2), 16));
                return n
            },
            "bytesToBase64"(t) {
                for (var r = [], e = 0; e < t.length; e += 3) {
                    const o = t[e] << 16 | t[e + 1] << 8 | t[e + 2];
                    for (let i = 0; i < 4; i++)
                        8 * e + 6 * i <= 8 * t.length ? r.push(n.charAt(o >>> 6 * (3 - i) & 63)) : r.push("=")
                }
                return r.join("")
            },
            "base64ToBytes"(t) {
                t = t.replace(/[^A-Z0-9+\/]/gi, "");
                for (var r = [], e = 0, o = 0; e < t.length; o = ++e % 4)
                    0 != o && r.push((n.indexOf(t.charAt(e - 1)) & Math.pow(2, -2 * o + 8) - 1) << 2 * o | n.indexOf(t.charAt(e)) >>> 6 - 2 * o);
                return r
            }
        };
        t.exports = r
    }()
},
    function(t, n) {
    function r(t) {
        return !!t.constructor && "function" == typeof t.constructor.isBuffer && t.constructor.isBuffer(t)
    }
    /* !
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
    t.exports = function(t) {
        return null != t && (r(t) || function(t) {
            return "function" == typeof t.readFloatLE && "function" == typeof t.slice && r(t.slice(0, 0))
        }(t) || !!t._isBuffer)
    }
},
    function(t, n, r) {
    t.exports = {
        "get"() {
            let t, n, r = "";
            for (t = 0; t < 32; t++) {
                n = 16 * Math.random() | 0,
                8 !== t && 12 !== t && 16 !== t && 20 !== t || (r += "-");
                const e = 3 & n
                  , o = 16 === t ? 8 | e : n;
                r += (12 === t ? 4 : o).toString(16)
            }
            return r
        }
    }
}
]);
使用示例
加密:【MD5】 --- s 值

UUID

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1517394.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

网络编程套接字(4)——Java套接字(TCP协议)

目录 一、Java流套接字通信模型 二、TCP流套接字编程 1、ServerSocket ServerSocket构造方法&#xff1a; ServerSocket方法: 2、Socket Socket构造方法&#xff1a; Socket方法&#xff1a; 三、代码示例&#xff1a;回显服务器 1、服务器代码 代码解析 2、客户端…

谁将主导未来AI市场?Claude3、Gemini、Sora与GPT-4的技术比拼

【最新增加Claude3、Gemini、Sora、GPTs讲解及AI领域中的集中大模型的最新技术】 2023年随着OpenAI开发者大会的召开&#xff0c;最重磅更新当属GPTs&#xff0c;多模态API&#xff0c;未来自定义专属的GPT。微软创始人比尔盖茨称ChatGPT的出现有着重大历史意义&#xff0c;不亚…

基于word2vec 和 fast-pytorch-kmeans 的文本聚类实现,利用GPU加速提高聚类速度

文章目录 简介GPU加速 代码实现kmeans聚类结果kmeans 绘图函数相关资料参考 简介 本文使用text2vec模型&#xff0c;把文本转成向量。使用text2vec提供的训练好的模型权重进行文本编码&#xff0c;不重新训练word2vec模型。 直接用训练好的模型权重&#xff0c;方便又快捷 完整…

软件无线电系列——模拟无线电、数字无线电、软件无线电

本节目录 一、模拟无线电 二、数字无线电 1、窄带数字无线电 2、宽带数字无线电 三、软件无线电本节内容 一、模拟无线电 20世纪80年代的模拟体制(美国的AMPS/欧洲的TACS)被称为第一代移动通信&#xff0c;简称1G,主要目标是为在大范围内有限的用户提供移动电话服务。最主要的…

uniapp遇到的问题

【uniapp】小程序中input输入框的placeholder-class不生效解决办法 解决&#xff1a;写在scope外面 uniapp设置底部导航 引用&#xff1a;https://www.jianshu.com/p/738dd51a0162 【微信小程序】moveable-view / moveable-area的使用 https://blog.csdn.net/qq_36901092/…

Figure与OpenAI 联手推出新机器人;荣耀首款「AI PC」即将发布

▶ Figure 与 OpenAI 联手推出新机器人 AI 机器人公司 Figure 发布了他们与 OpenAI 的合作成果&#xff0c;将 OpenAI 的大模型运用在其机器人 Figure 01 上。 据介绍&#xff0c;OpenAI 大模型加持的 Figure 01 机器人现在可以与人全面对话。 OpenAI 模型为机器人提供了高级…

微信小程序(五十九)使用鉴权组件时原页面js自动加载解决方法(24/3/14)

注释很详细&#xff0c;直接上代码 上一篇 新增内容&#xff1a; 1.使用覆盖函数的方法阻止原页面的自动执行方法 2.使用判断实现只有当未登录时才进行方法覆盖 源码&#xff1a; app.json {"pages": ["pages/index/index","pages/logs/logs"],…

mac删除带锁标识的app

一 、我们这里要删除FortiClient.app 带锁 常规方式删除不掉带锁的 app【如下图】 二、删除命令&#xff0c;依次执行即可。 /bin/ls -dleO /Applications/FortiClient.app sudo /usr/bin/chflags -R noschg /Applications/FortiClient.app /bin/ls -dleO /Applications/Forti…

2024计算机二级3

1. 2. 3. 4. 5. 6. append每次只能添加一个元素&#xff0c;两个元素都在同一个列表内相当于是一个整体 7. d.get后边括号内会存在一个默认值&#xff0c;如果题目给出的选项内没有已经存在的键值名&#xff0c;则会返回后边的默认值 8. 字典是映射数据类型&#xff0c;不属于…

【QT】TCP简易聊天框

我们首先复习一下TCP通信的流程 基于linuxTCP客户端和服务器 QT下的TCP处理流程 服务器先启动&#xff08;处于监听状态&#xff09; 各函数的意义和使用 QTcpServer Class *QTcpServer*类提供了一个基于TCP的服务器。这个类可以接受传入的TCP连接。您可以指定端口或让QTcpS…

碳储量监测的新技术:遥感在草原碳汇评估中的潜力

在全球环境问题日益严重的今天&#xff0c;以全球变暖为主要特征的气候变化成为了人类面临的巨大挑战。它威胁着地球的生态平衡&#xff0c;对全球可持续发展构成了严峻的挑战。为了应对这一挑战&#xff0c;各国纷纷采取行动&#xff0c;致力于实现碳达峰和碳中和的目标。 在…

Zabbix 监控 tomcat

zabbix-java-gateway服务组件 zabbix监控tomcat需要用到zabbix-java-gateway组件&#xff0c;它充当zabbix服务和java应用程序之间的网关。它允许zabbix服务器用过java网关与java应用程序进行通信&#xff0c;从而监控和收集java应用程序的性能数据。 zabbix-agent服务&#xf…

gradio部署视频输入输出示例,gradio网页输出视频nan,输出视频无法播放解决方法

gradio部署视频输入输出示例&#xff0c;gradio网页输出视频nan&#xff0c;输出视频无法播放 Opencv不能采用h64格式进行编码解决方案moviepy介绍浏览器接受的视频编码格式&#xff1a;采用h264编码合成视频&#xff1a; gradio部署视频输入输出示例Gradio视频组件使用详解简介…

小程序学习3 goods-card

pages/home/home home.wxml <goods-listwr-class"goods-list-container"goodsList"{{goodsList}}"bind:click"goodListClickHandle"bind:addcart"goodListAddCartHandle"/> <goods-list>是一个自定义组件&#xff0c;它具…

【MIT 6.S081】2020, 实验记录(8),Lab: locks

目录 Task 1&#xff1a;Memory allocator (moderate)</font>Task 2&#xff1a;Buffer cache (hard)</font> Task 1&#xff1a;Memory allocator (moderate) 这个任务就是练习将一把大锁拆分为多个小锁&#xff0c;同时可以更加深入地理解 memory allocator 运行…

PY32离线烧录器功能介绍,可批量烧录,支持PY32系列多款单片机

PY32离线烧录器可以对PY系列单片机进行批量烧录&#xff0c;现支持PY32F002A/002B/002/003/030/071/072/040/403/303芯片各封装和XL2409&#xff0c;XL32F001/003等芯片。PY32离线烧录器需要搭配上位机软件才能使用&#xff0c;上位机软件在我们官网&#xff08;www.xinlinggo.…

JVM基础篇

什么是JVM java虚拟机 JVM的功能 1.解释和运行 对字节码文件中的指令&#xff0c;实时的解释成机器码&#xff0c;让计算机执行 2.内存管理 自动为对象、方法等分配内存 自动的垃圾回收机制&#xff0c;回收不再使用的对象&#xff08;c不会自动回收&#xff0c;相当于降…

QT 如何防止 QTextEdit 自动滚动到最下方

在往QTextEdit里面append字符串时&#xff0c;如果超出其高度&#xff0c;默认会自动滚动到QTextEdit最下方。但是有些场景可能想从文本最开始的地方展示&#xff0c;那么就需要禁止自动滚动。 我们可以在append之后&#xff0c;添加如下代码&#xff1a; //设置编辑框的光标位…

指针的函数传参的详细讲解(超详细)

如果对指针基础知识已经有可以直接跳到 函数的指针传参与解引用&#xff0c;哪里不明白可以评论&#xff0c;随时解答。 目录 所以就有了一句话&#xff1a;指针就是地址&#xff0c;地址就是指针 对于指针在C语言中&#xff0c;指针类型就是数据类型&#xff0c;是给编译器…

PHP极简网盘系统源码 轻量级文件管理与共享系统网站源码

PHP极简网盘系统源码 轻量级文件管理与共享系统网站源码 极简网盘是一个轻量级文件管理与共享系统&#xff0c;支持多用户&#xff0c;可充当网盘程序&#xff0c;程序无需数据库 安装步骤&#xff1a; 1.建议安装在apache环境下&#xff0c;并确保.htaccess可用 2.解压文件…