import hashlib


def get_file_hash(file_list):
    """
    Gets an MD5 Hash value for each file in a list.
    Returns a dictionary of {file: hash} items
    """
    if type(file_list) != list:
        file_list = [file_list]
    BLOCKSIZE = 65536
    file_dict = {}
    for file in file_list:
        hasher = hashlib.md5()
        with open(file, 'rb') as afile:
            buf = afile.read(BLOCKSIZE)
            while len(buf) > 0:
                hasher.update(buf)
                buf = afile.read(BLOCKSIZE)
        file_dict[file] = hasher.hexdigest()
        # print(file.name, ":", hasher.hexdigest())
    return file_dict