Hasher

A tool for producing a consistent hash of a digital file.

To use in an API class, follow the standard convention accessing the tools property that Sermos injects.

Example:

class DemoApiClass(object):
    def post(self):
        TODO: Example

To use in a worker method, follow the standard convention accessing the tools argument that Sermos injects.

Example:

def demo_worker_task(event, tools):
    TODO: Example
class sermos_tools.catalog.hasher.hasher.Hasher

Generate a consistent hash of bytes, full text, etc.

Usage:

hasher = Hasher()
my_hash = hasher.hash_bytes(my_doc_bytes)
# or
my_hash = hasher.hash_string(my_doc_full_text)