V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
XTianLV
V2EX  ›  PHP

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

  •  
  •   XTianLV · 2018-11-04 17:27:29 +08:00 · 2639 次点击
    这是一个创建于 2246 天前的主题,其中的信息可能已经有所发展或是发生改变。

    求教如下代码如何调入 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。

    1 条回复    2018-11-05 13:46:08 +08:00
    w516322644
        1
    w516322644  
       2018-11-05 13:46:08 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2710 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 12:19 · PVG 20:19 · LAX 04:19 · JFK 07:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.