title: Delphi Lockbox Hashing
body: <p>I need to hash a string, preferably as SHA512, although it could be SHA256, SHA1, MD5 or CRC32.</p>
  
  <p>I have downloaded Lockbox 3, put a TCryptographicLibrary and a THash component on a form, set the Hash property to SHA-512 and used the following code to produce a test result:</p>
  
  <pre><code>procedure TForm1.Button1Click(Sender: TObject);
  begin
    Hash1.HashString('myhashtest');
    Edit1.Text := Stream_To_AnsiString(Hash1.HashOutputValue);
  end;
  </code></pre>
  
  <p>To best illustrate the problem, I have gone on to an online hash calculator and the MD5 hash of 'myhashtest' is <code>ff91e22313f0a41b46719e7ee6f99451</code> but setting the hash property in my test program to MD5 results in <code>ÿ‘â#ð¤Fqž~æù”Q</code> which is clearly wrong. I have tried the same test using other Hash properties, including the SHA512 which i want, and they all return rubbish.</p>
  
  <p>Where am I going wrong?</p>