This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# http://stackoverflow.com/a/1181922 | |
def base36encode(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'): | |
"""Converts an integer to a base36 string.""" | |
if not isinstance(number, int): | |
raise TypeError('number must be an integer') |