shortest possible hash value
<p>I have gone through this page...</p>

<p><a href="http://www.php.net/manual/en/function.hash.php" rel="nofollow">http://www.php.net/manual/en/function.hash.php</a></p>

<p>MD5 is 32 characters long while sha1 is 40.
For e.g.</p>

<pre><code>$str = 'apple';

sha1 string d0be2dc421be4fcd0172e5afceea3970e2f3d940
md5 string 1f3870be274f6c49b3e31a0c6728957f
</code></pre>

<p>Even if the optional raw_output is set to TRUE, then the md5 digest is instead returned in raw binary format with a length of 16.</p>

<p>I am looking for a function that will create hash that will be equal or less than 8 characters.</p>

<p>Update:
I need smaller strings for 3 reasons:</p>

<p>1) MySQL Archive table type does not seem to allow an index on a column that has more than 8 chars</p>

<p>2) I am planning to use key-value utility like redis that likes smaller keys</p>

<p>3) Security is not an issue here. I am hashing columns like "country + telco + operator"</p>
