Safe Base64 encoding/decoding in pure JavaScript.
MIT License
A pure JavaScript port of the libsodium base64 codecs.
Features:
Available on NPM: base64-ct
Usage:
const codec = new Base64(true);
const b64 = codec.encode(data);
const data2 = codec.decode(b64);
const codec = new Base64(false);
const b64 = codec.encode(data);
const data2 = codec.decode(b64);
const codec = new Base64UrlSafe(false);
const b64 = codec.encode(data);
const data2 = codec.decode(b64);
\n
:const codec = new Base64UrlSafe(true, " \n");
const b64 = codec.encode(data);
const data2 = codec.decode(b64);