Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the recommended alternatives to rand() #22873

Open
wants to merge 4 commits into
base: blead
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cpan/perlfaq/lib/perlfaq4.pod
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,14 @@ L<http://www.perlmonks.org/?node_id=803632>).
Several CPAN modules in the C<Math> namespace implement better
pseudorandom generators; see for example
L<Math::Random::MT> ("Mersenne Twister", fast), or
L<Math::TrulyRandom> (uses the imperfections in the system's
timer to generate random numbers, which is rather slow).
L<Math::Random::ISAAC> ("Indirection, Shift, Accumulate, Add, and Count", really fast).
More algorithms for random numbers are described in
"Numerical Recipes in C" at L<http://www.nr.com/>

There are several modules to sample system sources of random numbers,
which are useful for security tokens and cryptography. For example,
L<Crypt::URandom>.

=head2 How do I get a random number between X and Y?

To get a random number between two values, you can use the C<rand()>
Expand Down
8 changes: 2 additions & 6 deletions pod/perlfunc.pod
Original file line number Diff line number Diff line change
Expand Up @@ -6669,13 +6669,9 @@ including:

=over

=item * L<Data::Entropy>
=item * L<Crypt::URandom>

=item * L<Crypt::Random>

=item * L<Math::Random::Secure>

=item * L<Math::TrulyRandom>
=item * L<Crypt::PRNG>

=back

Expand Down
5 changes: 3 additions & 2 deletions t/porting/known_pod_issues.dat
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ Cpanel::JSON::XS
cpanp(1)
CPANPLUS
crypt(3)
Crypt::Random
Crypt::PRNG
Crypt::URandom
ctime(3)
curl(1)
Dancer
Expand Down Expand Up @@ -217,8 +218,8 @@ Math::Big
Math::BigInt::Constant
Math::BigInt::GMP
Math::BigInt::Pari
Math::Random::ISAAC
Math::Random::MT::Perl
Math::Random::Secure
Math::TrulyRandom
mbrlen(3)
mbrtowc(3)
Expand Down
Loading