I have a PHP script that can encode a PNG image to a Base64 string (which is pretty easy since there's a PHP library that provides Base64 conversion)
I'd like to do the same thing using Javascript (in the XUL Javascript environment). I know how to open files, but I'm not sure how to do the encoding? I'm not used to working with binary data.