V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
snailsir
V2EX  ›  算法

这是什么算法?

  •  
  •   snailsir · 2018-03-10 23:58:48 +08:00 · 3069 次点击
    这是一个创建于 2448 天前的主题,其中的信息可能已经有所发展或是发生改变。

    js 代码示例如下:

    
    m = 'a73fB/+LpWMfZ8qw17wtyhU5Ut9onnF1X7vGQyqSRmVquotlVw1HQYhg8czB17isSFoubUS9lP/DT1LdDLLdJyDcaMmpM40u0hNuBNULkExTf03uqsEL18I'
    r = 'YgzMGmvoqT9gatEC56wIH0bF80kqlOcj'
    
    var f_iVR2SlRR9weNau1TCve0RWupMxM5U3Rd = function (m, r, d) {
        var e = "DECODE";
        var r = r ? r : "";
        var d = d ? d : 0;
        var q = 4;
        r = md5(r);
        var o = md5(r.substr(0, 16));
        var n = md5(r.substr(16, 16));
        if (q) {
            if (e == "DECODE") {
                var l = m.substr(0, q)
            }
        } else {
            var l = ""
        }
        var c = o + md5(o + l);
        var k;
        if (e == "DECODE") {
            m = m.substr(q);
            k = base64_decode(m)
        }
        var h = new Array(256);
        for (var g = 0; g < 256; g++) {
            h[g] = g
        }
        var b = new Array();
        for (var g = 0; g < 256; g++) {
            b[g] = c.charCodeAt(g % c.length)
        }
        for (var f = g = 0; g < 256; g++) {
            f = (f + h[g] + b[g]) % 256;
            tmp = h[g];
            h[g] = h[f];
            h[f] = tmp
        }
        var t = "";
        k = k.split("");
        for (var p = f = g = 0; g < k.length; g++) {
            p = (p + 1) % 256;
            f = (f + h[p]) % 256;
            tmp = h[p];
            h[p] = h[f];
            h[f] = tmp;
            t += chr(ord(k[g]) ^ (h[(h[p] + h[f]) % 256]))
        }
        if (e == "DECODE") {
            if ((t.substr(0, 10) == 0 || t.substr(0, 10) - time() > 0) && t.substr(10, 16) == md5(t.substr(26) + n).substr(0, 16)) {
                t = t.substr(26)
            } else {
                t = ""
            }
        }
        return t
    };
    
    
    1 条回复    2018-03-11 02:26:02 +08:00
    weiwio
        1
    weiwio  
       2018-03-11 02:26:02 +08:00 via Android
    没头没尾,好好用 markdown,结贴屏蔽之
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1005 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 20:08 · PVG 04:08 · LAX 12:08 · JFK 15:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.