Signin  Pricing  Examples  Support

Libraries > base64.js

base64.js - Search Live Website Code
It's like doing CTRL+F on millions of websites' source code



NerdyData is a search engine for source code. Search the source code of 200 million websites.


JAVASCRIPT FILE http://va-ry.com/static/js/base64.js

Function Explorer




Libraries on va-ry.com


angular-file-upload-all.min.js

angular.min.js

angular-resource.min.js

angular-route.min.js

angular-sanitize.min.js

angular-tinymce.js

angular-touch.min.js

app.js

base64.js

bootstrap.min.js

common.js

FileAPI.min.js

jquery.ah-placeholder.js

jquery.min.js

jquery.nouislider.min.js

jquery.rating.js

tinymce.min.js

typeahead.bundle.js



Explore More


print.js

jquery.zdatepicker.js

en.lightbox.js

lbxgrid.js

base64.js
				
var base64list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';

function base64encode(s)
{
  var t = '', p = -6, a = 0, i = 0, v = 0, c;

  while ( (i < s.length) || (p > -6) ) {
    if ( p < 0 ) {
      if ( i < s.length ) {
        c = s.charCodeAt(i++);
        v += 8;
      } else {
        c = 0;
      }
      a = ((a&255)<<8)|(c&255);
      p += 8;
    }
    t += base64list.charAt( ( v > 0 )? (a>>p)&63 : 64 )
    p -= 6;
    v -= 6;
  }
  return t;
}

function base64decode(s)
{
  var t = '', p = -8, a = 0, c, d;

  for( var i = 0; i < s.length; i++ ) {
    if ( ( c = base64list.indexOf(s.charAt(i)) ) < 0 )
      continue;
    a = (a<<6)|(c&63);
    if ( ( p += 6 ) >= 0 ) {
      d = (a>>p)&255;
      if ( c != 64 )
        t += String.fromCharCode(d);
      a &= 63;
      p -= 8;
    }
  }
  return t;
}


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z