Truth be told, I actually copied this from a StackOverflow thread somewhere, perhaps to_base() was from another project maybe, and to36 just wrapped it. In fact, I should probably compare this with the pyx and ensure it's doing what it's supposed to be doing, as well as write some unit tests. I'll get this cleaned up tomorrow.