CodyKochmann
5/13/2015 - 2:49 PM

small base64 object for easy encoding/decoding with b64.e() and b64.d()

small base64 object for easy encoding/decoding with b64.e() and b64.d()

var b64=function(){
    // small base64 object for easy encoding/decoding with b64.e and b64.d
    // b64.eval() evaluates base64 stored javascript 
    // by: Cody Kochmann
    this.e = function(a){return(window.btoa(unescape(encodeURIComponent(a))))};
    this.d = function(a){return(decodeURIComponent(escape(window.atob(a))))};
    this.eval = function(a){return(eval(decodeURIComponent(escape(window.atob(a)))))};
}
b64=new b64();
class b64
  constructor:()->@
  e:(a)-> window.btoa unescape(encodeURIComponent(a))
  d:(a)-> decodeURIComponent escape(window.atob(a))
  eval:(a)-> eval decodeURIComponent(escape(window.atob(a)))

b64 = new b64