求教如何使用 v8js 在 PHP 中运行 js 代码并反回数值

2018-11-04 17:27:29 +08:00
 XTianLV

求教如下代码如何调入 v8js 运行啊。 var _="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",f={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(t){if(t.length<57)throw new Error("the key is too short.");this.sz=.charCodeAt(t[15])%(t.length-20)+10,this._ks=t.slice(-this._sz);for(var r=0;r<this._sz;++r)this.ks[r]=.charCodeAt(this._ks[r]%62);this._k16=[],this._k41=[],this._t16={},this._t41={};for(r=0;r<16;++r)this.k16[r]=.charAt(t[r]),this._t16[this._k16[r]]=r;for(r=0;r<41;++r)this.k41[r]=.charAt(t[r+16]),this._t41[this._k41[r]]=r},Hexch.prototype.dec=function(t){for(var r=this._t16,s=this._t41,h=this._ks,e=this._sz,i=0,o=t.replace(/[0-9A-Za-z]/g,function(t){return _.charAt((f[t]-h[i++%e]%62+62)%62)}),c="",a=0;a<o.length;){var n=o.charAt(a);/[\s\n\r]/.test(n)?(c+=n,++a):void 0!==r[n]?(c+=String.fromCharCode(16r[o.charAt(a)]+r[o.charAt(a+1)]),a+=2):(c+=String.fromCharCode(1681s[o.charAt(a)]+41*s[o.charAt(a+1)]+s[o.charAt(a+2)]),a+=3)}return c},reserve_seat=function(s,h,t){void 0===t&&(t="");var r=JSON.parse("[35,39,14,5,18,47,55,59,54,3,31,49,7,8,23,6,32,11,13,42,15,48,27,25,36,50,19,44,30,33,21,26,4,9,10,57,0,41,22,1,53,34,43,52,58,2,38,28,60,29,56,45,37,51,16,20,12,46,17,61,24,40]"),e=new Hexch(r);T.ajax_get(AJAX_URL+"libid="+s+"&"+e.dec("8OdOogMOFUBTsBRINoSqA8jWRKgRt8")+"="+h+"&yzm="+t,function(t){var r="undefined"==typeof _ORG||_ORG;"0"==t.code?(T.tips(t.msg),setTimeout(function(){location.href=t.url},1e3)):r&&1e3==t.code?show_yzm(function(t){reserve_seat(s,h,t)}):T.tips(t.msg)})};

其中,dec 函数,可以将 js 中的'8OdOogMOFUBTsBRINoSqA8jWRKgRt8'转换为 GphYMENCCHjcZQK。

2640 次点击
所在节点    PHP
1 条回复
w516322644
2018-11-05 13:46:08 +08:00

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

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

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

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

© 2021 V2EX