def to_base36(value):
    """Returns a base36 version of an integer"""
    buf = []
    while value:
        value, i = divmod(value, 36)
        buf.append(u'0123456789abcdefghijklmnopqrstuvwxyz'[i])
    return u''.join(reversed(buf)) or u'0'