This is my attempt at implementing Base64 - I aimed for IE4!
const base64_ie4 = require("base64-ie4");
console.log(base64_ie4.encode("Hello world!")); // SGVsbG8gd29ybGQh
console.log(base64_ie4.decode("SGVsbG8gd29ybGQh")); // Hello world!
<script src="base64-ie4.min.js"></script>
<script>
alert(window.Base64IE4.encode("Hello world!")); // SGVsbG8gd29ybGQh
alert(window.Base64IE4.decode("SGVsbG8gd29ybGQh")); // Hello world!
</script>