import binascii
import logging


def checkHeader(filename, headers, size):
    """
    The checkHeader function reads a supplied size of the file and checks against known signatures to determine
    the file type.
    :param filename: The name of the file.
    :param headers: A list of known file signatures for the file type(s).
    :param size: The amount of data to read from the file for signature verification.
    :return: Boolean, True if the signatures match; otherwise, False.
    """
    with open(filename, 'rb') as infile:
        header = infile.read(size)
        hex_header = binascii.hexlify(header)
        for signature in headers:
            if hex_header == signature:
                return True
            else:
                pass
        logging.warn('The signature for {} ({}) does not match known signatures: {}'.format(
            filename, hex_header, headers))
        return False