import string


def base62_encode(num: int) -> str:
    """
    Encode a positive number using 62 characters 0-1a-zA-Z
    """
    charset = string.digits + string.ascii_letters
    size = len(charset)
    result = ''
    while True:
        num, rem = num // size, num % size
        result += charset[rem]
        if num == 0:
            return ''.join(reversed(result))