A base64encoder with padding, what shall i say more? This version now includes the amazing improvements made by Jonas Magazinius and LeverOne, for more details visit the "sla.ckers"-forum @ http://sla.ckers.org/forum/read.php?24,36342 (web.archive.org)
If you are looking for a decoder give https://gist.github.com/atk/1020396 a try.
var
sigma ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
, sample = "140bytes rocks!"
, encoded = (function(...){...})(sample, sigma);
r
is not declared and spills the global scope. Since you do have enough chars left that should be no problem though.