PDA

View Full Version : Web Tool: base 64 Tool



crosswire
May 6, 2007, 04:11 PM
Here is a simple app to encode base 64 files.

Say u have a zip file you want to send in a text only post, Base 64 encode it and send it as an encoded text message, the recipeent can base64 decode it and save it back to the original zip file.

Base 64 (2^6) transmitts 6 bits of data for every 8 bits (byte). Not too decompressed and ignoring any padding bits.


Plan to Added binary string encode (eg "0100001010"), hex encode, and url encode.

http://www.megaupload.com/?d=8CMT0WRN
keywords: base64, base 64, hex, binary converter encode decode

PS. The code is hard to read, Plan to I may clean up as well and test properly later.

icymint3
May 8, 2007, 05:34 PM
might have a look at the code... sometime.

crosswire
May 23, 2007, 10:01 PM
Well I finally added hex, binary and url encode\decode\convert

The link above is updated

PS: One known minor bug exists. If the text is not changed on a successful encode or decode operation, then subsequently if the user does a single text change within the text box, there will have no update effect. This only occurs when url decode is repeated done and there is no more change in the output url. Typing a letter will not be read, but typing another letter (another text change) will cause all the text to update. I could fix it but it would make my code a bit more complicated again, so I am trying do it as elegantly as possible which takes hole heap a time, that is if I attempt to fix the bug.

The binary function is also very slow. Since I hardly use the app then I am not pressed to make it more performance efficient. I think of C++/asm as the route to make the format converter and then drop the dll in a c# project.

ferronrsmith
June 12, 2007, 02:11 PM
this type of encoding sounds dangerous. What happens of a bit isn't sent. Does it come equipped with checksums ???

crosswire
June 12, 2007, 06:00 PM
hmmm, what I normally do is send a md5 hash along with the base 64 text and the "md5 hashing" happens to be done by a separate program. Probably upload that second app when I find it on my machine.

The software has a bug - very large base64 text will not hold in the text box. I think it might have to do with the size limit of the text box control, but what I normally do is work in a file base mode. If I encode a large file then I save the base64 result to a text file. The read and copy the text from there using regular notepad. What I could do as a fix to the bug is to force the user to save the file if the file is too large, and notify him/her to use notepad

crosswire
June 19, 2007, 07:37 PM
Here is the Md5 hash app. It is simple and there is one cool thing about it, you can right-click any data file and send it to the app and it will display the hash of that data file.

http://www.megaupload.com/?d=4M5U2BIQ

To set up this feature only create a short cut to the app and place that short cut in

"C:\Documents and Settings\<user>\SendTo"
where <user> is just a placeholder for your login user name

digimon
June 20, 2007, 10:54 AM
are u using the convert.frombase64 function in this as well? i kind like base64 ever since i used it with xml to send bytes nested in the xml.

nice work crosswire

crosswire
June 20, 2007, 05:10 PM
are u using the convert.frombase64 function in this as well? i kind like base64 ever since i used it with xml to send bytes nested in the xml.

nice work crosswire

Thanks.

I did used Convert.FromBase64.

I also like base64 for it text base appearance.