115 chars version has the following issues:
1. 'abc' --> 'YWJjA===' (extra iteration if the input string is divisible by 3)
2. '\x00abc' --> '' (null character caused c = 0 in the first iteration)
3. 'abc\0\0\0\x00abc' --> 'YWJjAAAA' (same problem via 4 iteration)
This is variants to fix only for 1.
// 125
function(a,b,c,d,e,f){e=f='';for(;!d--|f%3?c=a[f]||~d?c<<8|a.charCodeAt(f++,d=4):0:e+=a[f-d-!!e]?b[c>>d*6&63]:'=';);return e}
// 122
function(a,b,c,d,e,f){e=f='';for(;!d--|f%3?c=c<<(~d?8:16)|a.charCodeAt(f++,d=4):e+=a[f-d-!!e]?b[c>>d*6&63]:'=';);return e}
function(a,b,c,d,e,f){e=f='';for(;!d--|f%3?c=c<<8|a.charCodeAt(f++,d=4):e+=a[f-d-!!e]?b[c>>(d?d:c=0)*6&63]:'=';);return e}
// 121
function(a,b,c,d,e,f){e=f='';for(;!d--|f%3?c=c<<8|a.charCodeAt(f++,d=4):e+=a[f-d-!!e]?b[c>>d*6&63]:'=';d?0:c=0);return e}
As we see it less than we need to shorten 123.
Quote
How about making it without the lookup table?
In my opinion is more important to add support for 2-bytes characters.
Or do base64decode (which is slightly more complicated due to the fact that the two methods are necessary "search" + "String.fromCharCode")
----------------------
~Veritas~