var TpLinkPassWordEnCode = {
_strDe: "RDpbLfCPsJZ7fiv",
_dic: "yLwVl0zKqws7LgKPRQ84Mdt708T1qQ3Ha7xv3H7NyU84p21BriUWBU43odz3iP4rBL3cD02KZciX" +
"TysVXiV8ngg6vL48rPJyAUw0HurW20xqxv9aYb4M9wK1Ae0wlro510qXeU07kV57fQMc8L6aLgML" +
"wygtc0F10a0Dg70TOoouyFhdysuRMO51yY5ZlOZZLEal1h0t9YQW0Ko7oBwmCAHoic4HYbUyVeU3" +
"sfQ1xtXcPcf1aT303wAQhv66qzW",
securityEncode: function (pwd) {
var dictionary = this._dic;
var output = "";
var len, len1, len2, lenDict;
var cl = 0xBB,
cr = 0xBB;
len1 = pwd.length;
len2 = this._strDe.length;
lenDict = dictionary.length;
len = len1 > len2 ? len1 : len2;
for (var index = 0; index < len; index++) { cl = 0xBB; cr = 0xBB; if (index >= len1) {
cr = this._strDe.charCodeAt(index);
} else if (index >= len2) {
cl = pwd.charCodeAt(index);
} else {
cl = pwd.charCodeAt(index);
cr = this._strDe.charCodeAt(index);
}
output += dictionary.charAt((cl ^ cr) % lenDict);
}
return output;
}
};
console.log(TpLinkPassWordEnCode.securityEncode("admin"));
转载请注明:清风亦平凡 » TpLink路由器登录密码加密算法