Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Explaining bit sets
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Berke Durak <berke@a...>
Subject: Re: [Caml-list] Holding a set of random integers of very wide range?
On Mon, Sep 02, 2002 at 09:10:18AM -0400, john.chu@east.sun.com wrote:
> For reasons I tried to explain in a previous draft of this e-mail and
> has been cut due to the amount of space it took, I need to generate
> multiple permuted lists of integers ranging from 0 to approximately
> 2^100 (or more, it's a bit open-ended unfortunately).

You can solve that problem in constant space by encrypting a counter
using a convenient block cipher (such as RC6 or idea).  Since
encryption is bijective, you are assured of not hitting the same
integer twice. You have to somehow encode and decode integers, but in
runs in constant space and time.
--
Berke

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners