Convert a positive integer to a base36 string.

    Taken from Stack Overflow and modified.

def _to_base36(number):
    """
    Convert a positive integer to a base36 string.

    Taken from Stack Overflow and modified.
    """
    if number < 0:
        raise ValueError("Cannot encode negative numbers")

    chars = ""
    while number != 0:
        number, i = divmod(number, 36)  # 36-character alphabet
        chars = _alphabet[i] + chars

    return chars or "0"