here.platform.utils.file module#
This module contains helper functions for various file operations.
- here.platform.utils.file.checksum(path_or_data: str | Path | bytes, hash_algo: str, chunk_num_blocks: int = 128) str[source]#
Calculate checksum for data in a file based on input hashing algorithm.
- Parameters:
path_or_data – A string representing path of the file.
hash_algo – A string representing name of hashing algorithm.
chunk_num_blocks – An int representing block size.
- Returns:
A checksum string.
- Raises:
ValueError – If file does not exist or hash_algo is not valid.