Re: [Q] string to int hash function for small range

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: [Q] string to int hash function for small range
Дата
Msg-id dcc563d10903072017m169cc932n6e24614764484cab@mail.gmail.com
обсуждение исходный текст
Ответ на [Q] string to int hash function for small range  ("V S P" <toreason@fastmail.fm>)
Ответы Re: [Q] string to int hash function for small range  ("V S P" <toreason@fastmail.fm>)
Список pgsql-general
On Sat, Mar 7, 2009 at 7:33 PM, V S P <toreason@fastmail.fm> wrote:
> I would like to have a function
> given a user id varchar(64) to get a hash number between 0 and 255.
>
> I first tried md5 but the number it returns is very big and cannot
> be converted to an INT
>
> there is likely a way to simply add ascii values of the userId together
> to get a small integer, but wanted to know if there are any other
> 'built-in' ways
>
> this is to get the database id based on user id.

In psql type this:

\df *hash*

В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: PostgreSQL upgrade from 8.2.3 to 8.3.5 (and also data migration)
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: [Q] Cluster design for geographically separated dbs