rsshub
Version:
Make RSS Great Again!
67 lines (66 loc) • 1.04 kB
JavaScript
//#region lib/routes/5eplay/utils.ts
const getAcwScV2ByArg1 = (arg1) => {
const pwd = "3000176000856006061501533003690027800375";
const hexXor = function(box, pwd) {
let res = "";
for (let i = 0; i < box.length && i < pwd.length; i += 2) {
let tmp = (Number.parseInt(box.slice(i, i + 2), 16) ^ Number.parseInt(pwd.slice(i, i + 2), 16)).toString(16);
if (tmp.length === 1) tmp = "0" + tmp;
res += tmp;
}
return res;
};
const unsbox = function(str) {
const code = [
15,
35,
29,
24,
33,
16,
1,
38,
10,
9,
19,
31,
40,
27,
22,
23,
25,
13,
6,
11,
39,
18,
20,
8,
14,
21,
32,
26,
2,
30,
7,
4,
17,
5,
3,
28,
34,
37,
12,
36
];
const res = [];
for (let i = 0; i < str.length; i++) {
const cur = str[i];
for (let j = 0; j < code.length; j++) if (code[j] === i + 1) res[j] = cur;
}
return res.join("");
};
return hexXor(unsbox(arg1), pwd);
};
//#endregion
export { getAcwScV2ByArg1 as t };