weldx.util.external_file.ExternalFile.calculate_hash#

static ExternalFile.calculate_hash(path_or_buffer, algorithm, buffer_size=65536)#

Calculate the hash of a file.

Parameters:
  • path_or_buffer (Union[str, pathlib.Path, bytes]) – Path of the file or buffer as bytes

  • algorithm (str) – Name of the desired hashing algorithm

  • buffer_size (int) – Size of the internally used buffer. The file will be read in corresponding chunks. No effect when hashing from buffer.

Returns:

The calculated hash

Return type:

str