Function - validate_file_hash

Function - validate_file_hash#

openfl.utilities.utils.validate_file_hash(file_path, expected_hash, chunk_size=8192)[source]#

Validate SHA384 hash for file specified.

This function validates the SHA384 hash of a file against an expected hash.

Parameters:
  • file_path (str) – The path to the file to validate. (absolute or relative to the current working directory) of the file to be opened or an integer file descriptor of the file to be wrapped.

  • expected_hash (str) – The expected SHA384 hash of the file.

  • chunk_size (int, optional) – The size of the chunks to read from the file. Defaults to 8192.

Raises:

SystemError – If the hash of the file does not match the expected hash.