Re: hash options

Поиск
Список
Период
Сортировка
От Chris Angelico
Тема Re: hash options
Дата
Msg-id CAPTjJmpSZMux+i5AuLheyJ0d_7po+__2EpHAv6XBTvE5P=DChQ@mail.gmail.com
обсуждение исходный текст
Ответ на hash options  ("Little, Douglas" <DOUGLAS.LITTLE@orbitz.com>)
Список pgsql-general
On Mon, Jan 23, 2012 at 2:59 AM, Little, Douglas
<DOUGLAS.LITTLE@orbitz.com> wrote:
>
> I’ve implemented with MD5.  It works fine,  the problem I have is the size of the md5 (32 bytes) is often longer than
theoriginal string – thus not accomplishing what I want – space savings. 

You can always use a truncated hash - for instance, take the first 6-8
hex digits of the MD5 or SHA1 hash. For human readability, that's
likely to be all you need (for instance, git references commits by
their SHA1 hashes, but you can work with just the first six digits
quite happily). Otherwise, can you provide more details on why you
need a hash, and why it wants to be shorter than the original?

Chris Angelico

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

Предыдущее
От: "Little, Douglas"
Дата:
Сообщение: hash options
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Database takes up MUCH more disk space than it should