This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // run length encoder/decoder, not useful when sequence has numbers already in it | |
| function encode_rle(r) { | |
| for (var o, i, n = 0, t = r.length, e = ""; t > n; ++n) void 0 !== o ? r[n] === o ? i++ :(e += i + o, | |
| o = r[n], i = 1) :(o = r[n], i = 1); | |
| return e + (i + o); | |
| } | |
| function decode_rle(r) { | |
| var t, n = /^\d+/.exec(r); | |
| return null === n ? "" :(n = n[0], t = r[n.length], Array(+n + 1).join(t) + decode_rle(r.substr((n + t).length))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ascii2binary(e, joiner) { | |
| return Array.prototype.map.call(e, function(e) { | |
| var t = e.charCodeAt(0).toString(2); | |
| return "00000000".substr(t.length) + t; | |
| }).join(joiner); | |
| } | |
| function binary2ascii(e, joiner) { | |
| if (!joiner)joiner=" "; //added so you can leave joiner blank e.g. joiner=""; | |
| return e.replace(RegExp(joiner + "*[01]{8}" + joiner + "*", "g"), function(e) { | |
| return String.fromCharCode(parseInt(e, 2)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Another Twitter string compressor. In base 36 I found over 18,000 posible combinations of letters only. | |
| //My name is Dave, there is character 㜊 (code 㜊) that looks like "ave" | |
| //javascript:alert(parseInt('ave', 36)), so I can literally encode my name to 2 characters instead of 5. | |
| document['wr'+'ite'](unescape("%3Ctextarea%20id=whak%20rows=%226%22%20cols=%2277%22%20onmouseover=%22this.select()%22%3EDave%20suggests%20that%20you%20visit%20www.ScriptCompress.com%20for%20many%20neat%20JavaScript%20programming%20tools!%3C%2Ftextarea%3E%3Cinput%20type=text%20id=%22szwhak%22%20size=%225%22%3E%3Cbr%3E%3Ctextarea%20id=%22pack%22%20rows=%226%22%20cols=%2277%22%20onmouseover=%22this.select()%22%3E%3C%2Ftextarea%3E%3Cinput%20type=text%20id=%22szpack%22%20size=%225%22%3E%3Cbr%3E%3Cinput%20type=%22button%22%20id=%22encoder%22%20onclick=%22encode(whak.value)%22%20value=%22Twit%20Compress%22%3E%3Cinput%20type=%22button%22%20id=%22decoder%22%20onclick=%22decode()%22%20value=%22Twit%20Decompress%22%3E")); | |
| function disf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In JavaScript, this will make an alert: | |
| eval(unescape(btoa("jW«·ý¼ÿnÕÈÿm0Ãöy'+B¢jkzË?Ùç(ý»ÿoÝ¿öý").replace(/\57/g,"\45"))); | |
| $DJ | |
| If you encode the above with Base64 it will give you the word JERK | |
| ,åD | |
| If you encode the above with Base64 it will give you the word LOVE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var $='WHAK',w=document,h='getElementById',a="javascript",k="value",o="packer"; | |
| w.writeln('<h4><a href="http://www.'+$+'.ca">JavaScript Source Code To Code Points Packer</a></h4>\ | |
| <textarea id=javascript rows=6 cols=77 onmouseover=this.select()>alert("www.'+$+'.com");<\/textarea>\ | |
| <br><textarea id=packer rows=6 cols=77 onmouseover=this.select()><\/textarea><br>\ | |
| <input value="Pack" type=button onclick="w[h](o)[k]=Pack_JS_2_Codepoints(w[h](a)[k]);"> \ | |
| <input value="Test" type=button onclick="eval(w[h](o)[k]);">'); | |
| function Pack_JS_2_Codepoints(W,H,A,K){K=W.replace(/./g,function(H){ | |
| return","+H.charCodeAt(0)});A="eval(String.fromCharCode("+K.replace(",","")+"));";return A} | |
| w[h](o)[k]=Pack_JS_2_Codepoints(w[h](a)[k]); | |
| //Try it on http://www.whak.ca/demo/codepoints-javascript-packer.htm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function replacer(W, H, A, K) { | |
| K = W.replace(new RegExp(H, "g"), A); | |
| return K; | |
| } | |
| var str = "WHom"; | |
| var find = "Ho"; | |
| var r3plac3 = "HAK\u002eco"; | |
| alert(replacer(str, find, r3plac3)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function possible(e, n, t, r, W) { | |
| if (0 === e.length) { | |
| return []; | |
| } | |
| if (1 === e.length) { | |
| return e[0]; | |
| } | |
| n = [], t = possible(e.slice(1)); | |
| for (r in t) { | |
| for (W = 0; W < e[0].length; W++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //uncombine combined combiners | |
| function Δ(n, t, r, o) { | |
| for (o = [], t = 0, r = n.length; r > t; ++t) { | |
| o.push(n.charAt(t)); | |
| } | |
| return o.join(" "); | |
| } | |
| alert(Δ("S̨̥̫͎̭ͯ̿̔̀ͅ")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function whak(e) { | |
| var r, n, t, a = ""; | |
| for (r = 0; r < e.length; r++) n = e.charCodeAt(r).toString(10), t = n[R = "replace"](/0/g, " ")[R](/1/g, "")[R](/2/g, "")[R](/3/g, "")[R](/4/g, "")[R](/5/g, " ")[R](/6/g, " ")[R](/7/g, " ")[R](/8/g, " ")[R](/9/g, " "), | |
| a += t + ""; | |
| return a;} | |
| function unwhak(o, r, n, t, a) { | |
| a = ""; | |
| o = o.split(""); | |
| for (r = 0; r < o.length; r++) n = o[r], t = n[R = "replace"](/ /g, "0")[R](//g, "1")[R](//g, "2")[R](//g, "3")[R](//g, "4")[R](/ /g, "5")[R](/ /g, "6")[R](/ /g, "7")[R](/ /g, "8")[R](/ /g, "9"), | |
| a += String.fromCharCode(parseInt(t, 10)); |