def encode_version(major: int, minor: int):
    """
    Encodes the version number into something that the binary ZIP format
    understands.

    Parameters
    ----------
    major
        Major version number (must not exceed 6553)
    minor
        Minor version number (must not exceed 9)

    Returns
    -------
    Encoded version number

    Raises
    ------
    ValueError
        If the major or minor values are inadequate
    """

    if major < 0 or minor < 0:
        raise ValueError(f"Negative version number was provided")

    if minor >= 10:
        raise ValueError(f'Minor "{minor}" cannot exceed 10.')

    version = major * 10 + minor

    if version > 0xFFFF:
        raise ValueError(f"Version {major}.{minor} is too high to be encoded")

    return version