title: converting hash value(md5, sha1 etc..) to integer in a fixed range
body: <p>Lets say I have an hash function md5 and I hash some string and it gives me the some value and I need to convert it into an integer value with a fixed range.</p>
  
  <p>As given here for <code>crc32()</code> <a href="https://stackoverflow.com/questions/7305297/algorithm-to-convert-md5-or-maybe-another-hashing-method-to-integer-where-it">algorithm to convert md5 (or maybe another hashing method?) to integer where it is possible to set possible resulting integer ranges (eg: 1-10000)?</a></p>
  
  <p>For example lets say:</p>
  
  <pre><code>$value=md5("dog");
  echo $value;
  
  Output: "06d80eb0c50b49a509b49f2424e8c805"`
  </code></pre>
  
  <p>Now I need to convert this value into integer so that I can use it in a look-up table of size 1000. Thus when I convert it the size of this hash value should be between 0 to 999. How can I do that? </p>