Friday, November 03, 2006

Uncombobulating text

I keep forgetting about these two tips, or rather, I get them confused. To decode some stream of data that is encoded as ASCII you can goto vim.org and read up my tip on it. Basically, install a plugin, and then run a quick search replace. I actually wrote a coder/decoder so that I could whip up custom password bookmarklets easily.

The other format is base64. I forget that ascii is base16 and base64 is, well, base64 and so has 64 different characters rather than the cleaner 16. In any event, I found this great tip for decoding base64. Don't follow the tip instructions, scroll down to the last comment on the tip, and use it instead:

:ruby require "base64"
:.rubydo $_=Base64.decode64 $_

No comments: