import string
import random


def generate_share_code(length: int):
    """
    Generate a share_code of random letters and numbers given a length.
    :param length: int - length.
    :return: str - share code.
    """
    letters_and_digits = string.ascii_letters + string.digits
    result_str = "".join(
        (random.choice(letters_and_digits) for _ in range(length))
    )
    return result_str