-
-
Notifications
You must be signed in to change notification settings - Fork 219
/
base64.min.js
1 lines (1 loc) · 1.23 KB
/
base64.min.js
1
!function(e){"use strict";if("object"==typeof exports&&null!=exports&&"number"!=typeof exports.nodeType)module.exports=e();else if("function"==typeof define&&null!=define.amd)define([],e);else{var t=e(),r="undefined"!=typeof self?self:$.global;"function"!=typeof r.btoa&&(r.btoa=t.btoa),"function"!=typeof r.atob&&(r.atob=t.atob)}}(function(){"use strict";var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function s(e){this.message=e}return(s.prototype=new Error).name="InvalidCharacterError",{btoa:function(e){for(var t,r,o,n,a=String(e),c=0,i="";c<a.length;){if(t=a.charCodeAt(c++),r=a.charCodeAt(c++),o=a.charCodeAt(c++),255<t||255<r||255<o)throw new s("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");i+=f.charAt((n=t<<16|r<<8|o)>>18&63)+f.charAt(n>>12&63)+f.charAt(n>>6&63)+f.charAt(63&n)}switch(a.length%3){case 0:return i;case 1:return i.slice(0,-2)+"==";case 2:return i.slice(0,-1)+"="}},atob:function(e){var t=String(e).replace(/[=]+$/,"");if(t.length%4==1)throw new s("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,o,n=0,a=0,c="";o=t.charAt(a++);~o&&(r=n%4?64*r+o:o,n++%4)&&(c+=String.fromCharCode(255&r>>(-2*n&6))))o=f.indexOf(o);return c}}});