function(input) {
			var output = [];
			var chr1, chr2, chr3, enc1, enc2, enc3, enc4, cdp1, cdp2, cdp3;
			var i = 0, il = input.length, b64 = chars;

			while (i < il) {

				cdp1 = input.charCodeAt(i++);
				cdp2 = input.charCodeAt(i++);
				cdp3 = input.charCodeAt(i++);

				chr1 = cdp1 & 0xff;
				chr2 = cdp2 & 0xff;
				chr3 = cdp3 & 0xff;

				enc1 = chr1 >> 2;
				enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
				enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
				enc4 = chr3 & 63;

				if (isNaN(cdp2)) {
					enc3 = enc4 = 64;
				} else if (isNaN(cdp3)) {
					enc4 = 64;
				}

				output.push(b64.charAt(enc1) + b64.charAt(enc2) + b64.charAt(enc3) + b64.charAt(enc4));
			}

			return output.join('');
		}
function(input) {
			var output = [];
			var chr1, chr2, chr3, enc1, enc2, enc3, enc4, cdp1, cdp2, cdp3;
			var i = 0, il = input.length, b64 = chars;

			while (i < il) {

				cdp1 = input.charCodeAt(i++);
				cdp2 = input.charCodeAt(i++);
				cdp3 = input.charCodeAt(i++);

				chr1 = cdp1 & 0xff;
				chr2 = cdp2 & 0xff;
				chr3 = cdp3 & 0xff;

				enc1 = chr1 >> 2;
				enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
				enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
				enc4 = chr3 & 63;

				if (isNaN(cdp2)) {
					enc3 = enc4 = 64;
				} else if (isNaN(cdp3)) {
					enc4 = 64;
				}

				output.push(b64.charAt(enc1) + b64.charAt(enc2) + b64.charAt(enc3) + b64.charAt(enc4));
			}

			return output.join('');
		}
function ( input ) { var output = [ ] ; var chr1 , chr2 , chr3 , enc1 , enc2 , enc3 , enc4 , cdp1 , cdp2 , cdp3 ; var i = 0 , il = input . length , b64 = chars ; while ( i < il ) { cdp1 = input . charCodeAt ( i ++ ) ; cdp2 = input . charCodeAt ( i ++ ) ; cdp3 = input . charCodeAt ( i ++ ) ; chr1 = cdp1 & 0xff ; chr2 = cdp2 & 0xff ; chr3 = cdp3 & 0xff ; enc1 = chr1 >> 2 ; enc2 = ( ( chr1 & 3 ) << 4 ) | ( chr2 >> 4 ) ; enc3 = ( ( chr2 & 15 ) << 2 ) | ( chr3 >> 6 ) ; enc4 = chr3 & 63 ; if ( isNaN ( cdp2 ) ) { enc3 = enc4 = 64 ; } else if ( isNaN ( cdp3 ) ) { enc4 = 64 ; } output . push ( b64 . charAt ( enc1 ) + b64 . charAt ( enc2 ) + b64 . charAt ( enc3 ) + b64 . charAt ( enc4 ) ) ; } return output . join ( '' ) ; }
Encodes data using base64 algorithm
@author Tyler Akins (http://rumkin.com)
@param {String} input
@returns {String}
@memberOf emmet.base64
Encodes data using base64 algorithm