Re: Hash/permutation function for object ID creation
- From: Kalle07 <kalle07@xxxxxxxx>
- Date: Tue, 29 Jul 2008 04:09:24 -0700 (PDT)
On 29 Jul., 10:20, Bruza <benr...@xxxxxxxxx> wrote:
I need a system to generate a series of "semi-random-non-repeating"Why not use the identity function? It is not semi-random at all, but
32-bit object IDs. For this, I plan to create a sequence counter
(starting from 0), then feed the sequence number, s, to a permutation
function, F(s). And use F(s) as the generated object ID. F() needs to
have the following properties:
1. F(x) is semi-random so that if the ID is partitioned into any
number of "buckets" (by equal range, or MOD hashing), each bucket
has roughly same number of objects.
2. F() has an inverse F' s.t. F(F'(x)) = x
3. Both F() and F'() are computationally "inexpensive" to compute
using mod-based hash bucket assignment should work perfectly well. I
think giving a good answer to your question requires information why
identity won't suffice.
.
- References:
- Hash/permutation function for object ID creation
- From: Bruza
- Hash/permutation function for object ID creation
- Prev by Date: Hash/permutation function for object ID creation
- Next by Date: Re: obvious ("dumb") question about oracles and P vs. NP
- Previous by thread: Hash/permutation function for object ID creation
- Next by thread: Re: Hash/permutation function for object ID creation
- Index(es):
Relevant Pages
|