<SCRIPT>
A = 62;
Function encode (){
VaR code = Document. getelementbyid ('code'). value;
Code = code. Replace (/[\ r \ n] +/g ,'');
Code = code. Replace (/'/g ,"\\'");
VaR TMP = code. Match (/\ B (\ W +) \ B/G );
TMP. Sort ();
VaR dict = [];
VaR I, T = '';
For (VAR I = 0; I <TMP. length; I ++ ){
If (TMP [I]! = T) dict. Push (t = TMP [I]);
}
VaR Len = dict. length;
VaR ch;
For (I = 0; I <Len; I ++ ){
Ch = num (I );
Code = code. Replace (New Regexp ('\ B' + dict [I] + '\ B', 'G'), ch );
If (CH = dict [I]) dict [I] = '';
}
Document. getelementbyid ('code '). value = "eval (function (P, A, C, K, E, D) {e = function (c) {return (C <? '': E (parseint (C/A) + (C = C % A)> 35? String. fromcharcode (C + 29): C. tostring (36)}; If (! ''. Replace (/^/, string) {While (c --) d [E (c)] = K [c] | E (C ); k = [function (e) {return d [e]}]; E = function () {return '\\\ W +'}; C = 1 }; while (c --) if (K [c]) P = P. replace (New Regexp ('\\\\ B' + E (c) + '\\\\ B', 'G'), K [c]); return p }("
+ "'" + Code + "'," + A + "," + Len + ", '" + dict. join ('|') + "'. split ('|'), 0 ,{}))";
}
Function num (c ){
Return (C <? '': Num (parseint (C/A) + (C = C % A)> 35? String. fromcharcode (C + 29): C. tostring (36 ));
}
Function run (){
Eval (document. getelementbyid ('code'). value );
}
Function decode (){
VaR code = Document. getelementbyid ('code'). value;
Code = code. Replace (/^ eval /,'');
Document. getelementbyid ('code'). value = eval (CODE );
}
</SCRIPT>
<Textarea id = Code Cols = 80 rows = 20>
<textarea id = "code" Cols = "80" rows = "20"> <input type = "button" onclick =" encode () "value =" encoding "> <input type =" button "onclick =" Run () "value =" execution "> <input type =" button "onclick =" decode () "value =" decoding ">
[Ctrl + A select all Note: To introduce external JS, refresh it before execution]