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

From Craig Ringer
Subject Re: Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?
Date
Msg-id 49FD27DE.6000008@postnewspapers.com.au
Whole thread Raw
In response to Re: Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?  ("Daniel Verite" <daniel@manitou-mail.org>)
List 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 by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?
Next
From: Craig Ringer
Date:
Subject: Re: Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?