title: Hash sum of an object in python
body: <p>In my script I work with large and complex object (a multi-dimentional list that contains strings, dictionaries, and class objects of custom types). I need to copy, pickle (cache) and unpickle it, as well as send between child processes through <code>MPI</code> interface. At some points I get suspicious that the data transfer is error-free, i.e. if in the end I have the same object.</p>
  
  <p>Therefore, I want to calculate its hash sum or some other type of fingerprint. I know that there is, for example, <code>hashlib</code> library; however, it is limited in terms of object type:</p>
  
  <pre><code>&gt;&gt;&gt; import hashlib
  &gt;&gt;&gt; a = "123"
  &gt;&gt;&gt; hashlib.sha224(a.encode()).hexdigest()
  '78d8045d684abd2eece923758f3cd781489df3a48e1278982466017f'
  &gt;&gt;&gt; a = [1, 2, 3]
  &gt;&gt;&gt; hashlib.sha224(a).hexdigest()
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: object supporting the buffer API required
  </code></pre>
  
  <p>Thus, the question: is there some analog of this function that works with objects of any type?</p>