b64u-lite
isomorphic base64url library in 244 bytes
Usage
const b64u = ; b64u;// aGkgdGhlcmU_IOS9oOWlvQ // add paddingb64u;// aGkgdGhlcmU_IOS9oOWlvQ== // convert a buffer to b64ub64u;// 5L2g5aW9 // convert b64u to a bufferb64u;// new Uint8Array([228, 189, 160, 229, 165, 189]).buffer // works with or without paddingb64u;b64u;// hi there? 你好 // equivalent to btoab64u;// aGkgdGhlcmU_IA // with paddingb64u;// aGkgdGhlcmU_IA== // equivalent to atobb64u;// hi there?
Can it be smaller?
If you use ES6 imports with a bundler that supports tree-shaking, yes!
License
MIT