这个JavaScript如何生成角色? 我想制作PHP版本。
这是打包的JavaScript代码
(function(options, lary) {
eval((function(g6) {
for (var R6 = "", c6 = 0, Q6 = function(g6, C6) {
for (var G6 = 0, x6 = 0; x6 < C6; x6++) {
G6 *= 96;
var r6 = g6.charCodeAt(x6);
if (r6 >= 32 && r6 <= 127) {
G6 += r6 - 32;
}
}
return G6;
}; c6 < g6.length;) {
if (g6.charAt(c6) != "`") R6 += g6.charAt(c6++);
else {
if (g6.charAt(c6 + 1) != "`") {
var o6 = Q6(g6.charAt(c6 + 3), 1) + 5;
R6 += R6.substr(R6.length - Q6(g6.substr(c6 + 1, 2), 2) - o6, o6);
c6 += 4;
} else {
R6 += "`";
c6 += 2;
}
}
}
return R6;
})("var e2h={\"Y0\":\"userAgent\",\"h6\":\"documentElem` 1!N0` ,&\"};(function(f,x,i,B){var f8=\"startTimeout\",t5=\"attachEvent\",p=\"add` ( Listener\",T8=\"write\",b8=\"readyState\",x5=\"pushupUrl\",K8=\"mahClicks\",q8=\"on` ) Trigger\",v8=\"toString\",J8=\"random\",a5=\"split\",B8=2592000000,F8=\"call\",u8=\"hostname\",n` \'\"\",W8=\"path` 2!e8=\"pomc\",a=\"test\",d5=\"retargetingFrameUrl\",D5=\"async\",r5=\"scripts\",E5=\"push\",U5=\"className\",Z5=\"indexOf\",o5=\"substr\",l5=\"target\",f5=\"startClicks\",M5=\"prefetch\",P5=\"head\",j5=\"inj\",T5=1,j=\"session` P#y` )$Timeout\",V5=\"dispatchEvent\",w5=\"initMouse` -\"b5=\"href\",S5=\"creat` 3#m=\"appendChild\",O5=\"body\",z=\"src\",L5=\"display\",A=\"style\",E=\"createElement\",i5=\"left\",k5=\"removeChild\",M=\"parentNode\",K5=\"zoneId\",S=\"clicksSinceSessionStart\",l=\"series` )\"p5=\"ppuTimeout\",q5=\"lastPpu\",I=\"clicksSinceL` \/#V` N C` 5 \",X` ) Qnty\",u` 4!ount\",g5=\"location\",U=\"url\",Y=\"open\",N=\"match\",w=\"cookie\",h5=\"limLo\",R5=\"SS\",b=\"domainSeriesForL` ;!Z=\"join\";function m5(){var R` L#\",Q=\"toUTCString\",c=e(G5,` L#(g){return r[g];})[Z](\'|\'),G,C;if(h[b]){G` >4n` I);}` O R5]&&D){K(` J$){D[J]=c;C=` $ ==c;` G b]){D[C5]=G;}});}` 1 h5]&&v&&!C){K(function(){v[J]` O\'v` S#C=` 6 ==c;});}if(C){return ` * Q8){x[w]=J+\'=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=\/\';` U [J+\'=\'+c,\'` V#\'+new Date(F()+V8)[Q](),\'` Q\",\'domain=\'+(h[R]||x[R])][Z](\'; \');C=(x[w][N](new RegExp(\'(^|; )\'+J+\'=([^;]*)\'))||[])[2]===c;}if(!C&&v&&!h[R5]){K(function(){v[J]=c;C=` $ ` M );}}` :# y5(){var R=\"opener\",Q=\"close\",c=\"mozPaintCount\",G=\"focus\",C=\"blur\",o=\"availHeight\",T` )\"Width\",W=\"getTime\",q=f[Y](G8?h[U]:\'about:blank\',\'ppu\'+new Date()[W](),[\'toolbar=0\',\'scrollbars=1\',\'location` ( statusbar` 6 menu` N#resizable` P top` 1 left` : width=\'+screen[T],\'height` *%o]][Z](\',\'));if(!q){return false;}q[C](` 7 A8){f` (!f[G]();}if(q[c]!==undefined){q[Y](\'about:blank\')[Q` J try{q[R]` W\"catch(g){}if(!G8){q[g5]=h[U];}return true;}function a8(){if(h[b]){` =\"n[u]<h[b]&&r` %!X];}` 6\"` )$&&(h[V]?!r[I]||r[I]>=h[V]:F()>r[q5]+h[p5]*1000);}function t8(){if(Y5()){r[l]=F();r[u]=0;r[S]=0;if(h[b]){n` 8#n` :!}}r[I]=1` D +` # u` # ` G&` +!}r[q5` V!m5();j8();if(c5()>0){L=setTimeout(H,c5());}f[\'ppuWasShownFor\'+h[K5]]=true;}function H(){var o=\"smartOverlay\",T=\"add` \'#;v5` T!if(X5()||!d){return ;}if(h[T]){o8({left:0,top:0,width:\'100%\',height` &#position:\'fixed\'});}if(h[o]){var W=[];(function q(){e(W,` )#(g){if(g[M]){g[M][k5](g);}});W=e(P(\'object, iframe, embed\'),function(g){var R=\"offsetHeight\",Q=\"smartOverlayMin` 2#c` C#Width\",G` 9,` 3!;if(!s5(g,true)){return ;}if(h[G]<=g[c]&&h[Q` \' R]){var C=l8(g);` I\"o8({left:C[i5]+\'px\',top:C.top` )!height:g[R` 9\"width:g[c` I\"position:\'absolute\'});}});B5=setTimeout(q,750);}());}}function H5(){K(` (#(){var g=\"border\",R=x[E](\'iframe\');R.width=0;R.height=0;R[A][g]=\'0\'` &!L5]=\'none\';R[z]=\'http:\/\/go.wbsfingerprn.com\/` &#int.html\';x[O5][m](R);});}function d8(){var g=x[E](\'a\'),R=x[S5](\'MouseEvents\');g[b5]=h[U];R[w5](\'click\',true,true,f,0,0,0,0,0` *\"alse,fals` ;\"0,null);g[V5](R);}function c5(){var g=\"min\";if(h[b]){return Math[g](n[l]+h[y]*1000-F(),r` \",);}` P\"r[u]<h[X]&&!h[V]?r[q5]+h[p5` E%:!h[j]?r[l]+h[y` .&-T5;}function X5(){var g=\"ppuDisableTrigger\";return f[g]&&!h[j5]` R&I5(g,R` Z!Q=R.length;while(Q){Q-=1;if(g===R[Q]){return true;}}` \'\"false;}function F(` @$+new Date()` 6&E8(){var c=x[P5]||P(\'head\')[0];e(h[M5],` H#(g` H!R=\"rel\",Q=x[E](\'link\');Q[R]=\'dns-prefetch\';Q[b5]=g;c[m](Q);});}function l8(g){var R=\"clientLeft\",Q=\"scroll` )!c=\"pageXOffset\",G` F#Top\",C` E#` ) o` F!Y` D#T=\"round\",W=\"getBoundingClientRect\",q=g[W]();return {top:Math[T](q.top+(f[o]||i[C]||d[C])-(i[G` ( G]||0)),left` M%[i5]+(f[c` R Q` R Q` Q!R` R R` Q!};}function P(Q){var c=[];K(` 1#(` 0!R=\"querySelectorAll\";c=e(x[R](Q),` G$g){return g;});});` (\"c;}` =# Q5(R){var Q=\"chromePopup\",c=\"srcElement\",G=\"event\";if(J5){if(h[f5]){c8+=1;if(c8>=` -\"N5();}}return ;}if(!z5()||(R&&!s5(R[l5]||f[G][c]))){if(h[j]){r[S]+=1` Q h[V` - I` ,!m5();if(` E &&h[j]===r[S])||` H &&r[u]<h[X]&&(h[b]?(n` ,!b]):true)&&h[V` S!I])){H();}return ;}t8();if(r8&&!x8){try{` 7\"f.top!==f?` % .open(h[U]):f[Y]` %!;}catch(g)` N$` 1&}if(h8||(s&&h[Q])` =$y5();}if(C8` Q$d8` -\"s||g8||x` 1%P` 6 ` O(function Y5(){var g=F();if(h[b]` R$g>n[l]+h[y]*1000;}` 2\"h[j]?!r[S]||r[S]>=h[j]:g>r` A*function z5(){` W\"!J5&&!X5()&&(Y5()||a8())` D&D8(R,Q){var c=Q.length\/2,G=Q[o5](0,c),C` &\"c),o;return eval(\'(\'+e(R,function(g){o=C[Z5](g)` C#o!==-T5?G[o]:g;})[Z](\'\')+\')\');}` U# s5(R,Q){var c=\"aggressive\",G=\"clickAnywhere\",C=\"includes\",o=\"concat\",T=\"ex` 0#W=\"toLowerCase\",q=\"tagName\",O=[],k=[],W5=R[q][W](),t;if(!Q){if(W5===\'object\'||` )!embed\'){return false;}}if(R[U5]===n5` 5$true;}t=h[T].length;while(t){t-=1;O=O[o](P(h[T][t]))` J!C` 92k=k` H#C` H#if(h[G]||(h[c]&&` S&&&!k` $\")){k[E5](i);}K(function(){var g=\"onClickExcludes\";O=O[o](f[g]);});while(R){if(I5(R,O)){return false;}` 2#k` 0%true;}R=R[M];}` A)function e(g,R){var Q=0,c=[],G;while(Q<g.length){G=R(g[Q],Q,g);if(G!==undefined){c[E5](G);}Q+=1;}return c;}function j8(){v5=false;e(P(\'.\'+n5),` ;#(g){if(g[M]){g[M][k5](g);}});if(L){clearTimeout(L);L=null;}if(B5` 0*B5` 6%}function N5(){J5=false;if(z5()){H();}else if(c5()>0){L=setTimeout(H,c5());}}function P8(){var g=x[E](\'a\'),R=x[S5](\'MouseEvents\');g[b5]=h[U];g[l5]=\'_blank\';R[w5](\'click\',true,true,f,1,0,0,0,0` *\"alse,fals` $#1,null);g[V5](R);}function U8(){var g=\"insertBefore\",R=\"type\",Q=\"getElementsByTagName\",c=h[r5].length,G=x[Q](\'script\')[0],C;while(c){c-=1;C=x[E` 9&;C[R]=\'text\/java` U\";C[D5]=true;C[z]=h[r5][c];G[M][g](C,G);}}function Z8(){var g=x[E](\'iframe\');g[A][L5]=\'none\';g[z]=h[d5];d[m](g);}function K(R,Q){try{return R();}catch(g){if(Q)` 3#Q` W }}var h=options,M8=lary;if(typeof h===\'string\'){h=D8(h,M8);}if(!h[b]||!h[h5` \"!X]){h[b]=0;}K(function(){var g=\"origin\";f.postMessage(h,location[g]);});var J5=true,c8=0,d,s=((B[N](\/Chrome\\\/([0-9]{1,})\/)||[])[1]|0)||` A$riOS` \/5,A8=\/applewebkit\/i[a](B),g8=\/android` +$h8=(\/A` \')&&\/Firefox` S#),r8=\/iPhone|iPad|iPod\/` I!,x8=r8&&\/Version\\\/` 2\"&&!s,G8=` \/%[^S]+Safari` U#C8=h[e8]&&g8&&s>=32,J=[\'__PPU_SESSION\',1,h[K5],h[h5]&&x[g5][W8]][Z](\'_\'),C5` F+_ON_DOMAI` U&(` T!n8]||` %!u8])][Z](\'_\'),Q8=(x[w]=\'__test\')[Z5][F8]` 2 ,` .$!==-T5,V8=B8,G5=[\'seriesStart\',\'ppuCount\',\'lastPpu\',\'clicksSinceSession` G#` \/&L` H\"],D,v;K(function(){var g=\"localStorage\",R=\"session` +#;D=f[R];v=f[g];});var F5,r=(function(){var Q=\"resetCounters\",c={},G,C,o;if(!h[Q]){if(h[R5]&&D){K(function(){C=D[J];F5=D[C5];o=!!C;});}` O h5]&&v&&!o){C=v` D\"v` ?\'if(!o&&Q8){C=(x[w][N](new RegExp(\'(^|; )\'+J+\'=([^;]*)\'))||[])[2];o=!!C;}if(!o&&v&&!h[R5]){C=v[J` 7$}G=(C||\'\')[a5](\'|\');e(G5,function(g,R){c[g]=parseInt(G[R],10)||0;});return c;}()),n={};if(h[b]){var w8=(F5||\'\')[a5](\'|\');e(G5,function(g,R){n[g]=parseInt(w8[R],10)||0;});}var n5=h[j5]?\'ppu_overlay\':\'p\'+Math[J8]()[v8](36)[o5](2),v5=false,L,B5,o8=(function(){var C=\"backgroundImage\",o=\"zIndex\",T=x[E](\'div\');T[U5]=n5;T[A][o]=h[o]` \'!C]=\'url(data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAE` , L` 1!BA` + IBRAA7)\';return function(g){var R=\"hasOwnProperty\",Q=\"cloneNode\",c=T[Q](false),G;for(G in g){if(g[R](G)){c[A][G]=g[G];}}d[m](c);return c;};}());f[q8]=Q5;if(h[r5]){U8();}` + K8]){K(function(){if(\/Firefox\\\/\/[a](B)){f.MouseEvent.prototype.z0=` P&};}});}if(h[x5]){if(x[b8]!==\'loading\'){var u5=document[E](\'script\');u5[z]=` [ ;u5[D5]=true;` E$P5][m](u5);}else{` 1$T8](\'<script defer async src=\"\'+h[x5]+\'\"><\/` ?!>\');}}(function S8(){if(P(\'body\').length>0){d=x[O5]||` 4$[0];if(h[M5]){K(E8);}` , d` +!Z` *\"v5){H();}}else{setTimeout(S8,100);}}());if(x[p]){x[p](s?\'mousedown\':\'click\',Q5,true` H !C8&&!h8` J\"\'touchstart` =&}}else if(x[t5]){` \" (\'onclick\',Q5);}if(!h[f5]){setTimeout(N5,h[f8]);}K(function(){var g=\"fprntOnWaitForLoad\",R` .$\";if(h[R]&&!h[g]){H5();}else ` 2$document[p]){window[p](\'load\',H5,false);}});}(` ;!,` A\"e2h.N0],` P\"` (\"` 2 h6],navigator` D Y0]))"));}("{\"tIvxfd\":7rrr,\"exxOhfp0eb\":2e0gf,\"exxOhfp0ebOvMfxce\":9plf,\"g3ep9Ohfp0eb\":9plf,\"g3ep9Ohfp0ebMcvWcx9a\":i4r,\"g3ep9Ohfp0ebMcvHfcua9\":srr,\"xcge80fOvMfxce\":2e0gf,\"60c6qAvboafpf\":9plf,\"euupfggchf\":9plf,\"pfgf9Cwlv9fpg\":2e0gf,\"0c3Lw\":2e0gf,\"gfggcwvTc3fwl9\":7snrr,\"zzlTc3fwl9\":i4,\"zzlQv9b\":5,\"cv60lxfg\":[],\"fd60lxfg\":[],\"lp0\":\"a99z:\\\/\\\/wv60c6qexg.vf9\\\/e2l.zaz?cx=7ss55r&z8q7=re71y7i5f56iie411f4s167f65n27e51nssk1i4kk7s1iskisni\",\"pf9epuf9cvuFpe3fUp0\":2e0gf,\"g9ep9Tc3fwl9\":r,\"g9ep9C0c6qg\":r,\"twvfIx\":7ss55r,\"zzlC0c6qg\":r,\"gfggcwvC0c6qg\":r,\"SS\":9plf,\"g6pcz9g\":[],\"zw36\":2e0gf,\"3eaC0c6qg\":9plf}", "abcdefghijklmnopqrstuvwxyz0123456789e86xf2uacmq03vwzjpg9lhodbtrs75i4n1yk"))
我试图在此网站上解压缩此代码http://www.strictly-software.com/unpack-javascript 但我真的不知道那是什么。
此JavaScript生成随机51个字符。像这样:6645a0e75cce8b7bbf315603373dce3c6119750240024580738
那么,我如何用PHP生成随机的51个字符? 你能帮我搞简单的PHP代码吗?
谢谢senpai ^^
答案 0 :(得分:0)
这样的东西?
$rand = substr(md5(microtime()),rand(0,26),51);
答案 1 :(得分:0)
你想要返回1个字符串,或51个单独的字符? 对于1个字符串,您可以执行以下操作:
function randomString($length = 51) {
$str = "";
$characters = array_merge(range('A','Z'), range('a','z'), range('0','9'));
$max = count($characters) - 1;
for ($i = 0; $i < $length; $i++) {
$rand = mt_rand(0, $max);
$str .= $characters[$rand];
}
return $str;
}