def hash_files(method, *files):
    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.
dataset/ETHPy150Open paylogic/pip-accel/pip_accel/utils.py/hash_files