def hash_files(method, *files):
    """
    Calculate the hexadecimal digest of one or more local files.

    :param method: The hash method (a string, given to :func:`hashlib.new()`).
    :param files: The pathname(s) of file(s) to hash (zero or more strings).
    :returns: The calculated hex digest (a string).
    """
    context = hashlib.new(method)
    for filename in files:
        with open(filename, 'rb') as handle:
            while True:
                chunk = handle.read(4096)
                if not chunk:
                    break
                context.update(chunk)
    return context.hexdigest()
Calculate the hexadecimal digest of one or more local files.

    :param method: The hash method (a string, given to :func:`hashlib.new()`).
    :param files: The pathname(s) of file(s) to hash (zero or more strings).
    :returns: The calculated hex digest (a string).