Convert any string to Base64 in JavaScript

95 Views Asked by At

I am looking to take the contents of a file as a string (any file type), and convert that string into a string of Base64 solely using JavaScript for the purpose of outputting in a blob url. In many cases btoa() does not work, obviously due to it not accepting information that is not 8 bit. I need to be able to convert any string into a Base64 string. If this is possible, can someone please provide a solution?

0

There are 0 best solutions below