123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <html>
- <head>
- <title>JSFuck - Write any JavaScript with 6 Characters: []()!+</title>
- <meta name="description" content="JSFuck is an esoteric and educational programming style based on the atomic parts of JavaScript. It uses only six different characters execute code.">
- <meta property="og:image" content="http://www.jsfuck.com/preview.png" />
- <meta name="viewport" content="width=device-width" />
- <style>
-
- body {
- padding: 20px;
- }
-
- body, * {
- font-family: monospace;
- font-size: 14px;
- line-height: 1.4em;
- }
-
- h1 {
- font-size: 2em;
- }
-
- h2 {
- width: 90px;
- text-align: right;
- padding: 50px 5px 5px;
- background: #F0DB4E;
- color: #323230;
- font-weight: bold;
- font-size: 20px;
- line-height: 1em;
- }
-
- h3 {
- font-weight: bold;
- }
-
- p, li, textarea {
- width: 100%;
- max-width: 600px;
- }
-
- textarea {
- display: block;
- height: 200px;
- margin: 1em 0;
- }
-
- ul.pre li{
- white-space: pre;
- }
-
- .checkbox {
- display: inline-block;
- }
-
- </style>
- </head>
- <body>
- <h1>JSFuck</h1>
-
- <h2>()+<br>[]!</h2>
-
- <p>JSFuck is an esoteric and educational programming style based on the
- atomic parts of JavaScript. It uses only six different characters to
- write and execute code.</p>
-
- <p>It does not depend on a browser, so you can even run it on Node.js.</p>
- <input id="input" type="text" value="alert(1)"/>
- <button id="encode" type="text">Encode</button>
-
- <div class="checkbox">
- <input id="eval" type="checkbox" checked />
- <label for="eval">Eval Source</label>
- </div>
-
- <textarea id="output"></textarea>
- <div id="stats"></div>
-
- <h3>Links</h3>
-
- <ul>
- <li>View source on <a href="http://github.com/aemkei/jsfuck">GitHub</a></li>
- <li>Follow <a href="http://twitter.com/aemkei">@aemkei</a> (Martin Kleppe)</li>
- <li>Original discussion at <a href="http://sla.ckers.org/forum/read.php?24,32930">Sla.ckers.org</a></li>
- <li>Alternatives: <a href="http://patriciopalladino.com/files/hieroglyphy/">Hieroglyphy</a> (8 chars), <a href="http://utf-8.jp/public/jsfuck.html">utf-8.jp</a> (broken)</li>
- </ul>
-
- <h3>Basics</h3>
-
- <ul class="pre">
- <li>'false' => ![]</li>
- <li>'true' => !![]</li>
- <li>'undefined' => [][[]]</li>
- <li>'NaN' => +[![]]</li>
-
- <li>'Array' => []</li>
- <li>'Number' => +[]</li>
- <li>'String' => []+[]</li>
- <li>'Boolean' => ![]</li>
- <li>'Function' => []["sort"]</li>
- <li>eval => []["sort"]["constructor"]( CODE )()</li>
- <li>window => []["sort"]["constructor"]("return this")()</li>
- </ul>
- <p>See the full list <a href="https://github.com/aemkei/jsfuck/blob/master/jsfuck.js">here</a>.</p>
- <script src="jsfuck.js"></script>
- <script>
- function $(id){
- return document.getElementById(id);
- }
-
- $("encode").onclick = function(){
- var output = JSFuck.encode($("input").value, $("eval").checked);
- $("output").value = output;
- $("stats").innerHTML = output.length + " chars";
- }
-
- $("encode").onclick();
- </script>
-
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-57649-11']);
- _gaq.push(['_trackPageview']);
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
- </body>
- </html>
|