b64-lite
Version:
isomorphic base64 library in 183 bytes
27 lines (21 loc) • 481 B
JavaScript
function atob(b64) {
return window.atob(b64);
}
function btoa(bin) {
return window.btoa(bin);
}
function toBase64(string) {
return btoa(unescape(encodeURIComponent(string)));
}
function fromBase64(b64) {
return decodeURIComponent(escape(atob(b64)));
}
var browser = {
atob: atob,
btoa: btoa,
toBase64: toBase64,
fromBase64: fromBase64
}
export { atob, btoa, toBase64, fromBase64 };
export default browser;
//# sourceMappingURL=b64-lite.mjs.map