
Math.random = function () {
    return 0.08636862211354912

}
var HN = new RegExp("[\\u007F-\\uFFFF]", "g");

function BB(ZY) {
    return "\\u" + ("0000" + ZY.charCodeAt(0).toString(16)).substr(-4);
}

function V0(QO, Y0) {
    var y2 = Y0;
    var l4 = QO;
    return function () {
        var oT = l4;
        oT ^= oT << 23;
        oT ^= oT >> 17;
        var mu = y2;
        oT ^= mu;
        oT ^= mu >> 26;
        y2 = oT;
        l4 = mu;
        return (l4 + y2) % 4294967296;
    };
}

function encodeStr2(ax, key) {
    var gs = Math["random"]() * 1073741824 | 0;
    console.log('gs', gs)
    var q7 = V0(key, gs);
    var xV = [];
    var QF = 0;
    while (QF < 2) {
        xV.push(q7() & 255);
        QF += 1;
    }
    console.log('xV', xV)
    var VI = xV;
    var CB = VI;


    var tY = JSON.stringify(ax, function (fd, FO) {
        return FO === undefined ? null : FO;
    });
    var nW = tY.replace(HN, BB);
    var cV = [];
    var qJ = 0;
    while (qJ < nW.length) {
        cV.push(nW.charCodeAt(qJ));
        qJ += 1;
    }
    console.log('cV', cV+'')
    var zy = cV;
    var Lr = zy;
    var fk = Lr.length;
    var RD = [];
    var M4 = fk - 1;
    while (M4 >= 0) {
        RD.push(Lr[M4]);
        M4 -= 1;
    }
    var or = RD;
    var Dz = or.length;
    var C5 = CB[0] % 7 + 1;
    var Rz = [];
    var Bw = 0;
    while (Bw < Dz) {
        Rz.push((or[Bw] << C5 | or[Bw] >> 8 - C5) & 255);
        Bw += 1;
    }
    var An = Rz;
    var IY = [];
    for (var l5 in An) {
        var bu = An[l5];
        if (An.hasOwnProperty(l5)) {
            var WJ = String.fromCharCode(bu);
            IY.push(WJ);
        }
    }
    var x4 = btoa(IY.join(""));
    return x4;

}

console.log(encodeStr2("98d5dc67cf9daf70d1cf77a0e572ea478aed7b47", 638959349))