SOURCE

function test() {
var k = "<authenticationinfo type='7.0 '><username>admin</username><password>ODg0ZGI0ZTBlNjJmY2Q1YjBlNTY5MWE2NjE1ZmM2ZTQ=</password><authenticationid>5690008407f6</authenticationid><apassword>admin123</apassword></authenticationinfo>";
var b = [61, 37, 44, 31, 34, 7, 24, 6, 43, 12, 27, 3, 25, 29, 60, 33, 35, 41, 58, 2, 51, 49, 9, 5, 59, 11, 42, 32, 22, 40, 4, 57, 50, 38, 8, 56, 21, 19, 52, 53, 16, 28, 1, 26, 47, 17, 54, 46, 10, 23, 55, 13, 14, 20, 15, 36, 18];
var p = new Hexch(b);
var e = p.enc(k);
return encodeURI(e);

};
	var a = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	var b = {
		"0": 0,
		"1": 1,
		"2": 2,
		"3": 3,
		"4": 4,
		"5": 5,
		"6": 6,
		"7": 7,
		"8": 8,
		"9": 9,
		A: 10,
		B: 11,
		C: 12,
		D: 13,
		E: 14,
		F: 15,
		G: 16,
		H: 17,
		I: 18,
		J: 19,
		K: 20,
		L: 21,
		M: 22,
		N: 23,
		O: 24,
		P: 25,
		Q: 26,
		R: 27,
		S: 28,
		T: 29,
		U: 30,
		V: 31,
		W: 32,
		X: 33,
		Y: 34,
		Z: 35,
		a: 36,
		b: 37,
		c: 38,
		d: 39,
		e: 40,
		f: 41,
		g: 42,
		h: 43,
		i: 44,
		j: 45,
		k: 46,
		l: 47,
		m: 48,
		n: 49,
		o: 50,
		p: 51,
		q: 52,
		r: 53,
		s: 54,
		t: 55,
		u: 56,
		v: 57,
		w: 58,
		x: 59,
		y: 60,
		z: 61
	};
	Hexch = function(c) {
		if (c.length < 57) {
			throw new Error("the key is too short.")
		}
		this._sz = a.charCodeAt(c[15]) % (c.length - 20) + 10, this._ks = c.slice(-this._sz);
		for (var d = 0; d < this._sz; ++d) {
			this._ks[d] = a.charCodeAt(this._ks[d] % 62)
		}
		this._k16 = [], this._k41 = [];
		this._t16 = {}, this._t41 = {};
		for (var d = 0; d < 16; ++d) {
			this._k16[d] = a.charAt(c[d]);
			this._t16[this._k16[d]] = d
		}
		for (var d = 0; d < 41; ++d) {
			this._k41[d] = a.charAt(c[d + 16]);
			this._t41[this._k41[d]] = d
		}
	};
	Hexch.prototype.enc = function(h) {
		var d = this._k16,
			c = this._k41,
			f = this._ks,
			e = this._sz,
			g = 0;
		return h.replace(/[^\s\n\r]/g, function(j) {
			var i = j.charCodeAt(0);
			return (i <= 255) ? d[parseInt(i / 16)] + d[i % 16] : c[parseInt(i / 1681)] + c[parseInt(i % 1681 / 41)] + c[i % 41]
		}).replace(/[0-9A-Za-z]/g, function(i) {
			return a.charAt((b[i] + f[g++ % e]) % 62)
		})
	};
	Hexch.prototype.dec = function(l) {
		var c = this._t16,
			d = this._t41,
			h = this._ks,
			e = this._sz,
			g = 0;
		if (l == null) {
			return
		}
		var j = l.replace(/[0-9A-Za-z]/g, function(m) {
			return a.charAt((b[m] - h[g++ % e] % 62 + 62) % 62)
		});
		var k = "";
		for (var f = 0; f < j.length;) {
			var i = j.charAt(f);
			if (/[\s\n\r]/.test(i)) {
				k += i;
				++f
			} else {
				if (c[i] !== undefined) {
					k += String.fromCharCode(c[j.charAt(f)] * 16 + c[j.charAt(f + 1)]);
					f += 2
				} else {
					k += String.fromCharCode(d[j.charAt(f)] * 1681 + d[j.charAt(f + 1)] * 41 + d[j.charAt(f + 2)]);
					f += 3
				}
			}
		}
		return k
	}

document.write(test());
console 命令行工具 X clear

                    
>
console