mltk.utils.hasher

Data hashing utilities

See the source code on Github: mltk/utils/hasher.py

Functions

generate_hash(*args)

Generate an MD5 hash of the given Python objects

hash_file(path[, algorithm, include_filename])

Generate a hash of the given file

hash_object(*objects[, hasher])

Hash the given object(s) and return the hashlib hasher instance

generate_hash(*args)[source]

Generate an MD5 hash of the given Python objects

Return type:

str

hash_file(path, algorithm='md5', include_filename=False)[source]

Generate a hash of the given file

Parameters:
  • path (str) –

  • algorithm (Union[str, hashlib._Hash]) –

  • include_filename (bool) –

Return type:

str

hash_object(*objects, hasher=None)[source]

Hash the given object(s) and return the hashlib hasher instance

If no hasher argument is provided, then automatically created a hashlib.md5()