how to allow integer overflow for calculating hash code of a string? - Mailing list pgsql-admin

From Haifeng Liu
Subject how to allow integer overflow for calculating hash code of a string?
Date
Msg-id BLU0-SMTP486A3A8F157C95DD76E23EB99A0@phx.gbl
Whole thread Raw
Responses Re: how to allow integer overflow for calculating hash code of a string?  (Craig James <cjames@emolecules.com>)
List pgsql-admin
I want to write a hash function which acts as String.hashCode() in java: hash = hash * 31 + s.charAt(i)... but I got
integerout of range error. How can I avoid this? I saw java do not care overflow of int, it just make the result
negative.

pgsql-admin by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Postgres Cache usage
Next
From: Craig James
Date:
Subject: Re: how to allow integer overflow for calculating hash code of a string?