title: Is there a way to generate hash integer within a predefined range for a string in PostgreSQL?
body: <p>For sharding I need good hash algorithm. I need to generate hash integer value for string within 0-2^31 range. Is this possible ?</p>
  
  <p>Following answer give a way to generate integer from md5 algorithm. </p>
  
  <p><a href="https://stackoverflow.com/questions/9809381/hashing-a-string-to-a-numeric-value-in-postgressql/9812029#comment42326057_9812029">Hashing a String to a Numeric Value in PostgresSQL</a></p>
  
  <p>But is there a way to generate this value within a range ?</p>