title: Calculate a MD5 hash from a string
body: <p>I use the following C# code to calculate a MD5 hash from a string.
  It works well and generates a 32-character hex string like this:
  <code>900150983cd24fb0d6963f7d28e17f72</code></p>
  
  <pre class="lang-cs prettyprint-override"><code>string sSourceData;
  byte[] tmpSource;
  byte[] tmpHash;
  sSourceData = "MySourceData";
  
  //Create a byte array from source data.
  tmpSource = ASCIIEncoding.ASCII.GetBytes(sSourceData);
  tmpHash = new MD5CryptoServiceProvider().ComputeHash(tmpSource);
  
  // and then convert tmpHash to string...
  </code></pre>
  
  <p>Is there a way to use code like this to generate a 16-character hex string (or 12-character string)? A 32-character hex string is good but I think it'll be boring for the customer to enter the code!</p>