title: How to produce unique values from long strings to use as table keys?
body: <p>I want to use files paths as key in my database tables. But using long strings as keys is not an efficient approach.</p>
  
  <p>So I thought of someway to reduce the size of path. <a href="http://msdn.microsoft.com/en-us/library/system.object.gethashcode%28v=vs.110%29.aspx" rel="nofollow">Object.GetHashCode()</a> looked great, specially when it returns an <code>int</code>. </p>
  
  <pre><code>var key = path.GetHashCode();
  </code></pre>
  
  <p>But it is written in the document:</p>
  
  <blockquote>
    <p>A hash code is intended for efficient insertion and lookup in
    collections that are based on a hash table. A hash code is not a
    permanent value. For this reason: </p>
    
    <ul>
    <li>Do not serialize hash code values or store them in databases.</li>
    <li>Do not use the hash code as the key to retrieve an object from a       keyed collection.</li>
    </ul>
  </blockquote>
  
  <p>So how to shorten a path string to use as a table key in DataBase?</p>