Re: Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?
Дата
Msg-id 49FD27DE.6000008@postnewspapers.com.au
обсуждение исходный текст
Ответ на Re: Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-general
Daniel Verite wrote:

> That's a permutation, as used in symmetric ciphering. A proven way to
> build one is to use a Feistel network:

Thanks. That looks to be pretty much what I'm after.

> Here is a plpgqsl implementation:

Wow. I really appreciate that. I'll have to test it out and chuck it on
the wiki (if that's OK with you) for future use, alongside whatever I
end up using for my check digit generator and verifier.

Come to think of it, check digits are almost unnecessary; after all, in
a large numeric space the chances of any misheard, typo'd, etc value
happening to be another valid value is pretty minimal. A simple
mod-10-of-sum-of-digits would probably be quite sufficient just to help
the UI differentiate between "Whoops, that number was incorrectly
entered or misheard" and "Customer not found".

--
Craig Ringer

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?