hashlib_interface#

ioapps.hashlib_interface.get_hash(filepath, hash_level=None)[source]#

DESCRIPTION:

This method defines and returns a secure hash for the user specified file path.

Parameters:
filepath: str

A Python string specifying the path to the file for which to generate a hash index.

Keywords:
hash_level: str, optional

A Python string specifying the hash level for the respective hash index; currently supported values are md5, sha1, sha224, sha256, sha384, and sha512; if NoneType upon entry, the md5 hash level is assumed.

Returns:
hash_index: str

A Python string containing the hash index for the user specified file path.

Raises:
HashLibError:
  • raise if the hash level specified upon entry is not supported.

Return type:

str