def number_to_digits(number, base):
    """Convert a positive number to its digit representation in base."""
    digits = []
    while number > 0:
        digits.insert(0, number % base)
        number  = number // base
    return digits