import hashlib


def md5(file_paths, chunk_size=1024*1024*1024):
    """ Calculate a md5 of lists of files. 

    Args:
        file_paths:  an iterable object contains files. Files will be concatenated orderly if there are more than one file
        chunk_size:  unit is byte, default value is 1GB
    Returns:
        md5

    """
    md5 = hashlib.md5()
    for path in file_paths:
        with open(path, 'rb') as fin:
            while True:
                data = fin.read(chunk_size)
                if not data:
                    break
                md5.update(data)
    return md5.hexdigest()