PHP: Hash function that generates a string with a given length : <p>I need a function that creates a hash from an arbitrary parameter set (or a serialized string) with a fixed length (say 5), as I need these hashes to serve as keys in an external database with a limited key length (so md5 will not work).</p>

<p>Is there such a function? Or should I use md5 and then substring it?</p>
