title: Hash algorithm with alphanumeric output of 20 characters max
body: <p>I need an hash algorithm that outputs an alphanumeric string that is max 20 characters long. For "alphanumeric" I mean <code>[a-zA-Z0-9]</code>.</p>
  
  <p>Inputs are <a href="http://en.wikipedia.org/wiki/Universally_unique_identifier#Definition" rel="noreferrer" title="UUID Wikipedia article">UUID</a>s in canonical form (example <code>550e8400-e29b-41d4-a716-446655440000</code>)</p>
  
  <p>In alternative is there a way to convert a SHA1 or MD5 hash to a string with these limitations?</p>
  
  <p>Thanks.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Doesn't need to be cryptographically secure. Collisions make data inaccurate, but if they happen sporadically I can live with it.</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>I don't know if truncating MD5 or SHA1 would make collisions happen too often. Now I'm wondering if it's better to truncate to 20 chars a MD5 value or a SHA1 value.</p>