Home | Flickr Photos | Links | About | Resume | Contact Me

Base36 in Python

Today I had to deal with some base36 encoded data in Python. Well my first instinct was “my_data”.decode(”base36″) which was a no-go. Next up, poke about in the base64 module since it also does base32 and base16; this netted me similar results. Asking Google got me some results but nothing I liked. It seems that people like to use static strings as lookup tables for the encoding which bothered me. I’m not sure why it bothered me, but it did. Anyhow, so I rolled my own this evening that I plan to use tomorrow. I offer it up to the world as (in my not so humble opinion) a superior choice to the other base36 implementations out there.

Check it out at: http://mike.crute.org/svn/projects/misc_modules/base36.py

If you find it useful or find a bug let me know. I probably won’t be doing much more with it other than bug fixes if there are any.

Leave a Reply




DISCLAIMER: The opinions expressed on this website are mine and mine alone, they should not be interpreted as the views of my employers, past or present, my family, my church or my pets. Comments are the property of their posters and I can not be held accountable for those.