owmeta_core.file_utils module

owmeta_core.file_utils.hash_file(hsh, fname, blocksize=None)[source]

Updates the given hash object with the contents of a file.

The file is read in blocksize chunks to avoid eating up too much memory at a time.

Parameters
hshhashlib.hash

The hash object to update

fnamestr

The filename for the file to hash

blocksizeint, optional

The number of bytes to read at a time. If not provided, will use hsh.block_size instead.