<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>140bytes challenges</title>
        <description>https://gist.github.com/962807

So this is pretty awesome there is a challenge to get certain stuff in js within 140 tweetable code. The first challenge is base64. They have an entry but it doesn't work correctly, it doesn't work on IE and doesn't encode single chars correctly. 

I had a shot and so far got 147:
function(a,b,c,d,e,f){d=f='';for(e in a)d+='0'+a[e].charCodeAt().toString(2);(d+'0000').replace(/.{6}/g,function($){f+=b[parseInt($,2)]});return f}

This should work for single characters such as &quot;a&quot; and multiple chars but doesn't support padding :( so slackers c'mon can you get it to 140 and correctly encode with padding?

Oh I forgot you call it like this:-
x('a'.split(''),'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')

with whatever name you give the func

Rules:
1. Works on IE9, Chrome, Safari, Firefox
2. </description>
        <link>http://sla.ckers.org/forum/read.php?24,36342,36342#msg-36342</link>
        <lastBuildDate>Sat, 18 May 2013 21:45:29 -0500</lastBuildDate>
        <generator>Phorum 5.2.15a</generator>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,42491#msg-42491</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,42491#msg-42491</link>
            <description><![CDATA[// 109<br />
<pre class="bbcode">function(a,b,c,d,e){for(d=e='';a[d|0]||(b='=',d%1);e+=b[63&amp;c&gt;&gt;8-d%1*8])c=c&lt;&lt;8|a.charCodeAt(d-=-.75);return e}</pre>]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Thu, 26 Jan 2012 04:07:25 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36476#msg-36476</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36476#msg-36476</link>
            <description><![CDATA[<b>Base64 decoder</b><br />
<br />
116:<br />
<pre class="bbcode">function(a,b,c,d,e){for(e='';~(c=c&lt;&lt;6|b.indexOf(a[d|=0]));d++%4?e+=String.fromCharCode(c&gt;&gt;(-d&amp;3)*2&amp;255):0);return e}</pre>
<br />
//added later<br />
115:<br />
<pre class="bbcode">function(a,b,c,d,e){for(e='';~(c=c&lt;&lt;6|b.indexOf(a[d|=0]));d++%4?e+=String.fromCharCode(c&gt;&gt;(d*6&amp;6)&amp;255):0);return e}</pre>
<br />
<br />
Notes:<br />
<br />
1. Why not &quot;search&quot; ? <br />
<br />
   1) alert(&quot;+&quot;.search(&quot;+&quot;)); <br />
   2) ~(c=c&lt;&lt;6|b.search(a[d|=0])) &lt;-- obviously endless loop if input data w/o &quot;=&quot;, as we see in older versions here [<a href="http://gist.github.com/1020396" rel="nofollow" >gist.github.com</a>]<br />
<br />
2. It's still the incorrect decoder. <br />
<br />
<blockquote class="bbcode"><div><small>Quote<br/></small><strong>http://tools.ietf.org/html/rfc2045</strong><br/>
<br />
Any characters outside of the base64 alphabet are to be ignored in<br />
base64-encoded data.</div></blockquote>
<br />
Join! :)<br />
<br />
<br />
<b>Correct decoder</b><br />
<br />
130:<br />
<pre class="bbcode">
function(a,b,c,d,e,f){f=e='';for(d in a)~(d=b.indexOf(a[+d]))&amp;&amp;(c=d|c&lt;&lt;6,f++%4)?e+=String.fromCharCode(c&gt;&gt;(f*6&amp;6)&amp;255):0;return e}</pre>
<br />
Notes:<br />
<br />
1. a[+d]  - to exclude custom prototypic methods/properties.<br />
<br />
2.<blockquote class="bbcode"><div><small>Quote<br/></small><strong>http://tools.ietf.org/html/rfc2045</strong><br/>
Because it is used only for padding at the end of the data, the<br />
occurrence of any &quot;=&quot; characters <b>may be</b> taken as evidence that the<br />
end of the data has been reached (without truncation in transit).</div></blockquote>
In this implementation &quot;=&quot; character is not regarded as an end of the data. Therefore, input &quot;YWJ=j&quot; will be decoded as &quot;abc&quot;.<br />
<br />
Example:<br />
<pre class="bbcode">alert(b64decode('YW %-) Jj','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'))</pre>
<br />
<b>To encode/decode UTF-8 string you can use this solution:</b><br />
<br />
<pre class="bbcode">alert(decodeURI(escape(b64decode('0YLQtdGB0YI=','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'))))</pre>
<pre class="bbcode">alert(b64encode(unescape(encodeURI('\u0442\u0435\u0441\u0442')),'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'))</pre>
<br />
[<a href="http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html" rel="nofollow" >ecmanaut.blogspot.com</a>]]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Tue, 14 Jun 2011 01:24:48 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36465#msg-36465</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36465#msg-36465</link>
            <description><![CDATA[Wow,<br />
just amazing, really really nice]]></description>
            <dc:creator>noma</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Fri, 10 Jun 2011 13:25:01 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36464#msg-36464</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36464#msg-36464</link>
            <description><![CDATA[Every time I open this thread I can't believe it. Nice work all of you]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Fri, 10 Jun 2011 10:57:29 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36463#msg-36463</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36463#msg-36463</link>
            <description><![CDATA[Jonas, you unleashed a few knots in the excellent work by noma, well done!<br />
<br />
another:<br />
<br />
a[d++]||(b='=')&amp;&amp;e --&gt;  a[d++]||(b='=',e)<br />
<br />
<br />
// 110<br />
<br />
function(a,b,c,d,e,f){for(d=f='';e&amp;=3,a[d++]||(b='=',e);f+=b[63&amp;c&gt;&gt;++e*2])c=c&lt;&lt;8|a.charCodeAt(d-=!e);return f}]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Fri, 10 Jun 2011 08:35:07 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36462#msg-36462</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36462#msg-36462</link>
            <description><![CDATA[Back from my short vacation!<br />
<br />
First off, fantastic work noma! I was trying to do something similar before, but never got it quite right. Your innovation inspired me to cut it down even further:<br />
<br />
113 chars:<br />
function(a,b,c,d,e,f){for(d=e=f='';a[d++]||(b='=')&amp;&amp;e;e&amp;=3)f+=b[63&amp;(c=c&lt;&lt;8|a.charCodeAt(d-=!e++))&gt;&gt;e*2];return f}<br />
<br />
Actually 112 chars:<br />
function(a,b,c,d,e,f){for(d=f='';e&amp;=3,a[d++]||(b='=')&amp;&amp;e;)f+=b[63&amp;(c=c&lt;&lt;8|a.charCodeAt(d-=!e))&gt;&gt;++e*2];return f}]]></description>
            <dc:creator>Jonas Magazinius</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Thu, 09 Jun 2011 22:13:47 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36460#msg-36460</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36460#msg-36460</link>
            <description><![CDATA[going, going...<br />
<br />
(the work in this thread has been inspiring, btw.)]]></description>
            <dc:creator>jedschmidt</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Thu, 09 Jun 2011 07:58:57 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36429#msg-36429</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36429#msg-36429</link>
            <description><![CDATA[117:<br />
<br />
function(c,d,b,a,g,e){for(b=a=e=&quot;&quot;;c[+b]||a;d=c[b++]?d:&quot;=&quot;)e+=d[63&amp;(g=g&lt;&lt;8|c.charCodeAt(b-=!(a=a+2&amp;7)))&gt;&gt;a];return e}]]></description>
            <dc:creator>noma</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Sat, 04 Jun 2011 15:37:43 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36417#msg-36417</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36417#msg-36417</link>
            <description><![CDATA[@noma<br />
<br />
1. nice move!<br />
2. you have 114.<br />
3. and yes, it was fix for issue №1 only. Full fix for single loop version looks like this:<br />
<br />
function(a,b,c,e,i,j){for(e=i='';!j|i%3?!!a[+i]|i%3|(c=j*c&lt;&lt;6|a.charCodeAt(i++,j=4)):e+=a[!e+i-j--]?b[c&gt;&gt;j*6&amp;63]:'=';);return e}<br />
<br />
upd:  126<br />
<br />
function(a,b,c,e,i,j){for(e=i='';!j|i%3?j|(c=j*c&lt;&lt;6|a.charCodeAt(i++,j=4))||a[i-1]:e+=a[!e+i-j--]?b[c&gt;&gt;j*6&amp;63]:'=';);return e}<br />
<br />
<br />
<b>upd:  120</b><br />
<br />
function(a,b,c,e,i,j){for(e=i='';a[+i]||j;)!j|i%3?c=c&lt;&lt;8|a.charCodeAt(i++,j=4):e+=a[!e+i-j--]?b[c&gt;&gt;j*6&amp;63]:'=';return e}]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Fri, 03 Jun 2011 16:54:36 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36406#msg-36406</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36406#msg-36406</link>
            <description><![CDATA[115 (again):<br />
<br />
function(a,b,c,e,i,j){for(e=i='';!j|i%3?c=c*j&lt;&lt;6|a.charCodeAt(i++,j=4):e+=a[!e+i-j--]?b[c&gt;&gt;j*6&amp;63]:'=';);return e}<br />
<br />
thx for the little welcome :)<br />
<br />
It will be interesting to see when no further byte can be squeezed out<br />
<br />
<br />
---<br />
<br />
Hmmmm, none of the single loop versions can handle 0-input strings like &quot;\0&quot;, &quot;\0\0&quot;, &quot;\0\0\0&quot;, ....]]></description>
            <dc:creator>noma</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Thu, 02 Jun 2011 21:30:28 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36405#msg-36405</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36405#msg-36405</link>
            <description><![CDATA[116:<br />
<br />
function(a,b,c,d,e,f){for(e=f='';!d|f%3?c=d*c/d&lt;&lt;8|a.charCodeAt(f++,d=4):e+=a[!e+f-d--]?b[c&gt;&gt;d*6&amp;63]:'=';);return e}<br />
<br />
aaand!]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Thu, 02 Jun 2011 19:38:34 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36404#msg-36404</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36404#msg-36404</link>
            <description><![CDATA[118:<br />
<br />
function(a,b,c,d,e,f){for(e=f='';!d|f%3?c=(d?c:0)&lt;&lt;8|a.charCodeAt(f++,d=4):e+=a[!e+f-d--]?b[c&gt;&gt;d*6&amp;63]:'=';);return e}<br />
<br />
<br />
@noma <br />
<br />
Welcome :)]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Thu, 02 Jun 2011 19:14:40 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36402#msg-36402</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36402#msg-36402</link>
            <description><![CDATA[@noma<br />
<br />
Welcome to the forums, assuming that code works you're awesome! Nice work]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Thu, 02 Jun 2011 19:03:48 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36400#msg-36400</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36400#msg-36400</link>
            <description><![CDATA[120:<br />
<br />
function(a,b,c,d,e,f){e=f='';for(;!d|f%3?c=c&lt;&lt;8|a.charCodeAt(f++,d=4):e+=a[!e+f-d--]?b[c&gt;&gt;d*6&amp;63]:'=';d?0:c=0);return e}<br />
<br />
119:<br />
<br />
function(a,b,c,d,e,f){for(e=f='';!d|f%3?c=c&lt;&lt;8|a.charCodeAt(f++,d=4):e+=a[!e+f-d--]?b[c&gt;&gt;d*6&amp;63]:'=';c=d?c:0);return e}]]></description>
            <dc:creator>noma</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Thu, 02 Jun 2011 16:39:34 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36399#msg-36399</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36399#msg-36399</link>
            <description><![CDATA[115 chars version has the following issues:<br />
<br />
1. 'abc' --&gt; 'YWJjA===' (extra iteration if the input string is divisible by 3)<br />
2. '\x00abc' --&gt; ''  (null character caused c = 0 in the first iteration)<br />
3. 'abc\0\0\0\x00abc' --&gt; 'YWJjAAAA'  (same problem via 4 iteration)<br />
<br />
This is variants to fix only for 1. <br />
<br />
// 125<br />
<pre class="bbcode">function(a,b,c,d,e,f){e=f='';for(;!d--|f%3?c=a[f]||~d?c&lt;&lt;8|a.charCodeAt(f++,d=4):0:e+=a[f-d-!!e]?b[c&gt;&gt;d*6&amp;63]:'=';);return e}</pre>
// 122<br />
<pre class="bbcode">function(a,b,c,d,e,f){e=f='';for(;!d--|f%3?c=c&lt;&lt;(~d?8:16)|a.charCodeAt(f++,d=4):e+=a[f-d-!!e]?b[c&gt;&gt;d*6&amp;63]:'=';);return e}</pre>
<pre class="bbcode">function(a,b,c,d,e,f){e=f='';for(;!d--|f%3?c=c&lt;&lt;8|a.charCodeAt(f++,d=4):e+=a[f-d-!!e]?b[c&gt;&gt;(d?d:c=0)*6&amp;63]:'=';);return e}</pre>
// 121<br />
<pre class="bbcode">function(a,b,c,d,e,f){e=f='';for(;!d--|f%3?c=c&lt;&lt;8|a.charCodeAt(f++,d=4):e+=a[f-d-!!e]?b[c&gt;&gt;d*6&amp;63]:'=';d?0:c=0);return e}</pre>
<br />
As we see it less than we need to shorten 123.<br />
<br />
<blockquote class="bbcode"><div><small>Quote<br/></small><strong></strong><br/>
How about making it without the lookup table?</div></blockquote>
<br />
In my opinion is more important to add support for 2-bytes characters.<br />
Or do base64decode (which is slightly more complicated due to the fact that the two methods are necessary &quot;search&quot; + &quot;String.fromCharCode&quot;)]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Thu, 02 Jun 2011 16:20:02 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36397#msg-36397</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36397#msg-36397</link>
            <description><![CDATA[How about making it without the lookup table?<br />
<br />
Something like:<br />
c=(c&lt;27?c+65:c&lt;53?c+70:c&lt;57?c-4:47);<br />
<br />
Which could obviously be shorter but you get the idea]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Wed, 01 Jun 2011 12:36:02 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36396#msg-36396</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36396#msg-36396</link>
            <description><![CDATA[This is still work in progress, but I have to share this.<br />
<br />
Single loop, incorrect padding and can't handle null chars, but it's beautiful!<br />
<br />
99 chars:<br />
function(a,b,c,d,e,f){for(e=f='';!d--||f%3?c=c&lt;&lt;8|a.charCodeAt(f++,d=4):e+=b[c&gt;&gt;d*6&amp;63];);return e}<br />
<br />
<br />
Single loop, correct padding, but can't handle null chars:<br />
<br />
115 chars:<br />
function(a,b,c,d,e,f){for(e=f='';!d--||f%3?c=c&lt;&lt;8|a.charCodeAt(f++,d=4):e+=a[f-d-!!e]?b[c&gt;&gt;d*6&amp;63]:'=';);return e}<br />
<br />
<br />
Now fellow sla.ckers, I think this can be corrected and reduced even further. Let's do this together!]]></description>
            <dc:creator>Jonas Magazinius</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Wed, 01 Jun 2011 12:17:01 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36393#msg-36393</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36393#msg-36393</link>
            <description><![CDATA[Another easy way of getting the binary bit pattern:<br />
<br />
s = 'hello',k = '';<br />
<br />
for(i in s) k += '0'+s.charCodeAt(i).toString(2);<br />
<br />
Then simply do a modulo 6 in the base64 char index.]]></description>
            <dc:creator>Skyphire</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Wed, 01 Jun 2011 05:29:56 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36390#msg-36390</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36390#msg-36390</link>
            <description><![CDATA[Previous versions of the code (123,121,120) contains an error: if the input string is <b>empty</b>, they return &quot;A===&quot;. Fixed version again 123 bytes. <br />
<br />
<br />
<pre class="bbcode">function(a,b,c,d,e,f){for(e=f='';a&amp;&amp;b[d=4];)for(c=c&lt;&lt;8|a.charCodeAt(f++);f%3?0:d--;b=a[f-d]?b:'=')e+=b[c&gt;&gt;d*6&amp;63];return e}</pre>]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Tue, 31 May 2011 22:05:42 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36389#msg-36389</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36389#msg-36389</link>
            <description><![CDATA[120:<br />
<br />
function(a,b,c,d,e,f){for(e=f='';b[d=4];)for(c=c&lt;&lt;8|a.charCodeAt(f++);f%3?0:d--;b=a[f-d]?b:'=')e+=b[c&gt;&gt;d*6&amp;63];return e}]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Tue, 31 May 2011 19:11:19 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36388#msg-36388</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36388#msg-36388</link>
            <description><![CDATA[121:<br />
function(a,b,c,d,e,f){for(e=f='';b[1];d=4)for(c=c&lt;&lt;8|a.charCodeAt(f++);f%3?0:d--;b=a[f-d]?b:'=')e+=b[c&gt;&gt;d*6&amp;63];return e}]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Tue, 31 May 2011 18:49:14 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36387#msg-36387</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36387#msg-36387</link>
            <description><![CDATA[:O<br />
<br />
Amazing!]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Tue, 31 May 2011 18:19:23 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36386#msg-36386</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36386#msg-36386</link>
            <description><![CDATA[Ok, I think I've reached a fixpoint for now.<br />
<br />
No cheating, no leaking, merged two loops.<br />
<br />
123 chars:<br />
function(a,b,c,d,e,f){for(e=f='';b[1];d=4)for(c=c&lt;&lt;8|a.charCodeAt(f++);!(f%3)&amp;&amp;d--;b=a[f-d]?b:'=')e+=b[c&gt;&gt;d*6&amp;63];return e}]]></description>
            <dc:creator>Jonas Magazinius</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Tue, 31 May 2011 17:26:02 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36380#msg-36380</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36380#msg-36380</link>
            <description><![CDATA[<blockquote class="bbcode"><div><small>Quote<br/></small><strong></strong><br/>But I managed to reduce it a bit</div></blockquote>
<br />
Only when you change the rules. :)<br />
<br />
<blockquote class="bbcode"><div><small>Quote<br/></small><strong></strong><br/>and map string ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/</div></blockquote>
<br />
How much do you have if you do not change the rules?<br />
<br />
upd: I guess that 130. Nice!]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Mon, 30 May 2011 14:56:07 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36379#msg-36379</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36379#msg-36379</link>
            <description><![CDATA[@LeverOne: Brilliant work as usual! But I managed to reduce it a bit..<br />
<br />
129 chars:<br />
function(a,b){for(var c=d=e=f='';a[+f];){for(;c=c&lt;&lt;8|a.charCodeAt(f++),f%3;);for(d=4;d--;)e+=b[a[f-d-!!e]?c&gt;&gt;d*6&amp;63:64]}return e}]]></description>
            <dc:creator>Jonas Magazinius</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Mon, 30 May 2011 14:43:03 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36378#msg-36378</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36378#msg-36378</link>
            <description><![CDATA[@Wisec<br />
<br />
PoC? :)<br />
<br />
-------------<br />
^<br />
| At first I took it as а &quot;3 bytes shorter version&quot;. LOL<br />
-------------<br />
<br />
<b>UPDATE 06/11/2001</b><br />
<br />
Here's the history of base64 encoder outside sla.ckers<br />
<br />
<b>1.</b> [<a href="https://gist.github.com/988463" rel="nofollow" >gist.github.com</a>] by <b>bytespider</b>  <br />
<br />
158, '=' - in map with index 64<br />
<blockquote class="bbcode"><div><small>Quote<br/></small><strong></strong><br/><pre class="bbcode">function(a,b,c,d,e,f,g,h){h=&quot;&quot;;for(d=0;a[d];h+=b[e&gt;&gt;2]+b[e&lt;&lt;4&amp;63|f&gt;&gt;4]+b[f&lt;&lt;2&amp;63|g&gt;&gt;6||64]+b[g&amp;63||64])for(c=4;c&lt;7;)arguments[c++]=a.charCodeAt(d++);return h}</pre></div></blockquote>
<br />
<b>2.</b> [<a href="https://gist.github.com/989006" rel="nofollow" >gist.github.com</a>] by <b>aemkei</b><br />
<br />
140, w/o padding, !IE<br />
<blockquote class="bbcode"><div><small>Quote<br/></small><strong></strong><br/><pre class="bbcode">function(a,b,c,d,e,f,g){for(g=c=e=&quot;&quot;;(d=a.charCodeAt(g))&amp;&amp;(c+=/.{8}$/(1e7+d.toString(2))),f=c.substr(g++*6,6);)e+=b[parseInt(f,2)];return e}</pre></div></blockquote>
<br />
<b>3.</b> [<a href="https://gist.github.com/999166" rel="nofollow" >gist.github.com</a>] by <b>nignag</b> &lt;-- possibly <b>noma</b><br />
<br />
A lot of bright ideas in revisions; padding as an independent variable in the function declaration.]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Mon, 30 May 2011 13:23:13 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36377#msg-36377</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36377#msg-36377</link>
            <description><![CDATA[we &lt;3 LeverOne :)]]></description>
            <dc:creator>Wisec</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Mon, 30 May 2011 13:04:07 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36360#msg-36360</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36360#msg-36360</link>
            <description><![CDATA[<b>RULES:</b> [<a href="https://github.com/jed/140bytes/wiki/Wishlist" rel="nofollow" >github.com</a>]<br />
<blockquote class="bbcode"><div><small>Quote<br/></small><strong></strong><br/>Encode: a function that takes the <b>string input</b> and <b>map string</b> ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/, return the base64 encoding. Bonus points for proper &quot;=&quot; padding. [UPDATE] Much progress has been made <a href="http://gist.github.com/989006" rel="nofollow" >here</a>, but it's still not cross-browser due to lack of executable RegExps in IE.</div></blockquote>
<br />
<pre class="bbcode">
b64encode=

function(a,b){for(var c=d=e=f='';c=0,a[+f];){for(d=3;d--;c|=a.charCodeAt(f++)&lt;&lt;d*8);for(d=4;d--;)e+=a[f-d-!!e]?b[c&gt;&gt;d*6&amp;63]:'='}return e}  
// 137

/* or
function(a,b,c,d,e,f){for(e=f='';c=0,a[+f];){for(d=3;d--;c|=a.charCodeAt(f++)&lt;&lt;d*8);for(d=4;d--;)e+=a[f-d-!!e]?b[c&gt;&gt;d*6&amp;63]:'='}return e}  
// 137
*/

alert(b64encode('a\r\nab','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'))</pre>
<br />
1. Correct padding for 8- and 16-bits input.<br />
2. Any chars within 0-255 (dec).<br />
3. Leakage in global scope is eliminated (using &quot;var&quot; etc.)<br />
4. IE 8-9, Chrome, Safari, Firefox, Opera <br />
<br />
LeverOne]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Sat, 28 May 2011 01:27:00 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36349#msg-36349</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36349#msg-36349</link>
            <description><![CDATA[Here's a FF one for fun:<br />
<br />
('0'+[''.charCodeAt.call(x,i).toString(2)for(i in x='abc')].join(0)).replace(/.{1,6}/g,function(c)b[parseInt(c,2)])]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Wed, 25 May 2011 12:42:00 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?24,36342,36348#msg-36348</guid>
            <title>Re: 140bytes challenges</title>
            <link>http://sla.ckers.org/forum/read.php?24,36342,36348#msg-36348</link>
            <description><![CDATA[Ok, here's one. Not very optimized, but handles all input with correct padding:<br />
<br />
y='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';<br />
x=function(a)a.charCodeAt();<br />
'\xff\xff\xff'.replace(/(.)(.)?(.)?/g,function(_,a,b,c)y[x(a)&gt;&gt;2]+y[63&amp;x(a)&lt;&lt;4|x(b)&gt;&gt;4]+(b?y[63&amp;x(b)&lt;&lt;2|x(c)&gt;&gt;6]:'=')+(c?y[63&amp;x(c)]:'='))]]></description>
            <dc:creator>Jonas Magazinius</dc:creator>
            <category>Obfuscation</category>
            <pubDate>Wed, 25 May 2011 12:31:36 -0500</pubDate>
        </item>
    </channel>
</rss>
