js 加密 运行报错

2018-07-22 00:41:07 +08:00
 bestehen

https://www.v2ex.com/t/471332#reply29 原帖 因为算法内容太多,所以只保留小部分

if (1 === o) { var D = N.length, j = 0; D && (j = N.charCodeAt(D - 1)), j<=8 && (N = N.substring(0, D - j)) }

N ==decodeURIComponent(escape(N)) } return N }

/home/shenjianlin/js/code.js:42 N ==decodeURIComponent(escape(N)) ^

URIError: URI malformed at decodeURIComponent (native) at a (/home/shenjianlin/js/code.js:42:6) at n (/home/shenjianlin/js/code.js:57:19) at Object.<anonymous> (/home/shenjianlin/js/code.js:64:13) at Module._compile (module.js:577:32) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.runMain (module.js:611:10)

3473 次点击
所在节点    Node.js
3 条回复
skinny
2018-07-22 09:20:32 +08:00
你应该好好学英语。
airdge
2018-07-22 20:38:49 +08:00
atob 换成这个
function atob(a) {
var b, c, e, d, f, g = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1];
d = a.length;
e = 0;
for (f = ""; e < d;) {
do b = g[a.charCodeAt(e++) & 255]; while (e < d && -1 == b);
if (-1 == b) break;
do c = g[a.charCodeAt(e++) & 255]; while (e < d && -1 == c);
if (-1 == c) break;
f += String.fromCharCode(b << 2 | (c & 48) >> 4);
do {
b = a.charCodeAt(e++) & 255;
if (61 == b) return f;
b = g[b]
} while (e < d && -1 == b);
if (-1 == b) break;
f += String.fromCharCode((c & 15) << 4 | (b & 60) >> 2);
do {
c = a.charCodeAt(e++) & 255;
if (61 == c) return f;
c = g[c]
} while (e < d && -1 == c);
if (-1 == c) break;
f += String.fromCharCode((b & 3) << 6 | c)
}
return f
}
bestehen
2018-07-23 01:00:08 +08:00
@airdge 已经解决,谢谢,主要原因是字符串太长,被隐藏了!

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/473004

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX