I need to convert some strings using Base64 encoding, and was delighted to see that I didn't have to roll my own converter-Java provides one with. To be useful, your decoding routine needs to be more robust, or you need to write a pre-decode scrubbing routine. If it was a message that was replied to or forwarded, it might have those ">" crap in it. It will most likely have line breaks and other white space. If I get a base64 encoded file, it most likely came from an e-mail or a newsgroup. I also notice that your decoding routine assumes that all bytes given to it are base64 characters to be decoded. (don't worry it will not overwrite the source file) Let us know if the original file and the outputted original file is not the same. The new example file makes it easy to do, but it is a slow process so only do small files (less then 100k). Please test out converting to and from base64 with files. Your function is super fast! It takes me 18.5 seconds to encode a pic using my function, but 2.5 using yours! I'm going to combine the two if you don't mind. It's more targeted at converting binary to base64, so it's probably slower on text files than one that is targeted at text files.base64 to file converter download️Download īlindwig, your using bit operations and you have the base64 alphabet hardcoded. It's not really finished, kind of a work in progress that never got finished.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |