how to allow integer overflow for calculating hash code of a string?

Поиск
Список
Период
Сортировка
От Haifeng Liu
Тема how to allow integer overflow for calculating hash code of a string?
Дата
Msg-id BLU0-SMTP486A3A8F157C95DD76E23EB99A0@phx.gbl
обсуждение исходный текст
Ответы Re: how to allow integer overflow for calculating hash code of a string?  (Craig James <cjames@emolecules.com>)
Список 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 по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Postgres Cache usage
Следующее
От: Craig James
Дата:
Сообщение: Re: how to allow integer overflow for calculating hash code of a string?