Decodes a Base64 string into a raw Uint8Array. Uses native Buffer in Node.js and fallbacks to atob in browsers.
Buffer
atob
The Base64 string to decode
A Uint8Array of the decoded data
const buf = base64ToBuffer('aGk='); Copy
const buf = base64ToBuffer('aGk=');
Decodes a Base64 string into a raw Uint8Array. Uses native
Bufferin Node.js and fallbacks toatobin browsers.