http://www.perlmonks.org?node_id=1090708


in reply to Re: Check randomly generated numbers have not been used before
in thread Check randomly generated numbers have not been used before

In that case, just store the srand seed and recreate the bitmap as needed.

  • Comment on Re^2: Check randomly generated numbers have not been used before

Replies are listed 'Best First'.
Re^3: Check randomly generated numbers have not been used before
by BrowserUk (Patriarch) on Jun 21, 2014 at 00:52 UTC
    just store the srand seed and recreate the bitmap as needed.

    It takes 25 milliseconds to write the (10 million bit) bitmap out and then read it back.

    It takes over 20 85 207 minutes to recreate the first million picks.

    Math::Random::MT is excellent; but it's not fast.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.