title: Storing MD5 digest in Postgres
body: <p>I'm generating MD5 digests with Python like so:</p>
  
  <pre><code>import hashlib
  m = hashlib.m5()
  md5 = m.update('some_string')
  return md5.digest()
  </code></pre>
  
  <p>Now, looking at <a href="https://stackoverflow.com/questions/15982737/postgresql-data-type-for-md5-message-digest">a similar SO question</a>, I see that you should use the <a href="http://www.postgresql.org/docs/9.0/static/datatype-binary.html" rel="nofollow noreferrer">bytea</a> type. However, I plan using the above snippet to generate these digests, although I'm open to modifying it. Is there anything I should be aware of being sending this off to the DB assuming that I have a field of type bytea? Would this be the proper way of storing digests? Might be a redundant question, but I wanted to be sure. I'm just storing md5s of files and was planning on using the hash as a unique identifier; nothing mission critical.</p>