class_docstr: A subclass of pickler, to do cryptographic hashing, rather than
  pickling.
class_docstr_tok: ["A","subclass","of","pickler",",","to","do","cryptographic","hashing",",","rather","than","pickling","."]
code: def hash(self, obj, return_digest=True):
      try:
          self.dump(obj)
      except pickle.PicklingError as e:
          e.args += ("PicklingError while hashing %r: %r" % (obj, e),)
          raise
      dumps = self.stream.getvalue()
      self._hash.update(dumps)
      if return_digest:
          return self._hash.hexdigest()
  
imports: import pickle
  import hashlib
  import sys
  import types
  import struct
  import io
  from ._compat import _bytes_or_unicode, PY3_OR_LATER
label_desc: Use image node_id 2 for calling the Hasher obj's underlying member method code with example usage: obj.hash(obj, return_digest) and returns: self