title: SHA512 Python produced different result for the same string
body: <p>I have a list of ids that I want to append with the string 'text'.
  I want to check if any of the ids (after being appended with the 'text' string) equals to the string 'text_compare'. </p>
  
  <p>What the weird thing is that the string before the hashing takes place are equal, but after the hashing takes place, the hashing seem to not have produced the same results. Below are my code. You can test it on the Python command-line.</p>
  
  <pre><code>import hashlib
  h = hashlib.sha512()
  
  text = 'beruk makye'
  text_compare = '3beruk makye'
  text_compare_hash = h.update(text_compare)
  text_compare_hash = h.hexdigest()
  
  ids = [1,2,3]
  texts = []
  bool_text = []
  bool_text_hash = []
  
  for id in ids:
      texts.append(str(id) + text)
  
  for t in texts:
      if t == text_compare:
          bool_text.append(True)
      else:
          bool_text.append(False)
  
  for t in texts:
      h.update(t)
      t_hash = str(h.hexdigest())
      if t_hash == text_compare_hash:
          bool_text_hash.append(True)
      else:
          bool_text_hash.append(False)
  
  print ids
  # [1, 2, 3]
  print texts
  # ['1beruk makye', '2beruk makye', '3beruk makye']
  print bool_text
  # [False, False, True]
  print bool_text_hash
  # [False, False, False]
  </code></pre>