def binary_encoding_gs1_ai_key(key: str):
    """
    Encode a GS1 application identifier key into a binary number.
    :param key: GS1 application identifier key.
    :return: Encoded binary string.
    """
    binary_ai_key = ''.join(["{0:b}".format(int(char_, 16)).zfill(4)
                             for char_ in key])
    return binary_ai_key