loading...

re: Encoding mess with Javascript VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Try these, they seem to work with all the examples from Stack Overflow const asciiToBase64 = ascii => Buffer.from(ascii).toString('base64'); c...
 

Yes, that works well but only in node environment. In javascript in the browser, Buffer is not accessible and thus you need to go with the atob or btoa solution (if you don't want some complex webpack that can simulate a buffer or any external buffer-ish libraries).

Code of Conduct Report abuse