|1 Math::TrulyRandom||The Math::TrulyRandom module provides a way of obtaining truly random data by using timing interrupts. This is probably one of the better ways to seed the algorithm.|
|2 /dev/random||Using the system random device is, in principle, the best idea, since it gathers entropy from various sources including interrupt timing, other device interrupts, etc. However, its not portable to anything other than Unix-like platforms, and might not produce good data on some systems.|
|3 localtime()||This works for basic things like simulations, but results in not-so-random output, especially if you create new instances quickly (as the seeds would be the same within per-second resolution).|
|4 Time::HiRes||In theory, using Time::HiRes is the same as option (2), but you get a higher resolution time so youre less likely to have the same seed twice. Note that you need to transform the output into an integer somehow, perhaps by taking the least significant bits or using a hash function. This would be less prone to duplicate instances, but its still not ideal.|
Math::Random::ISAAC->new( @seeds )
my $rng = Math::Random::ISAAC->new(time);
Returns a random double-precision floating point number which is normalized between 0 and 1 (inclusive; its a closed interval).
my $next = $rng->rand();
This method will return a double-precision floating point number or throw an exception on error.
my $next = $rng->irand();
This method will return a 32-bit unsigned integer or throw an exception on error.
The intent of this module is to provide single simple interface to the two compatible implementations of this module, namely, Math::Random::ISAAC::XS and Math::Random::ISAAC::PP.
print Backend type: , $Math::Random::ISAAC::DRIVER, "\n";
In order to force use of one or the other, simply load the appropriate module:
o Special thanks to Bob Jenkins <firstname.lastname@example.org> for devising this very clever algorithm and releasing it into the public domain. o Thanks to John L. Allen (contact unknown) for providing a Perl port of the original ISAAC code, upon which Math::Random::ISAAC::PP is heavily based. His version is available on Bobs web site, in the SEE ALSO section.
Math::Random::ISAAC::XS, the C/XS optimized version of this module, which will be used automatically if available.
<http://burtleburtle.net/bob/rand/isaacafa.html>, Bob Jenkins page about ISAAC, which explains the algorithm as well as potential attacks.
<http://eprint.iacr.org/2006/438.pdf>, a paper entitled On the pseudo-random generator ISAAC, which claims there are many seeds which will produce non-uniform results. The author, Jean-Philippe Aumasson, argues ISAAC should be using rotations (circular shifts) instead of normal shifts to increase diffusion of the state, among other things.
<http://eprint.iacr.org/2001/049.pdf>, a paper by Marina Pudovkina discussing plaintext attacks on the ISAAC keystream generator. Among other things, it notes that the time complexity is <B>Tmet = 4.67*10^1240B>, so it remains a secure cipher for practical applications.
o There is no method that allows re-seeding of algorithms. This is not really necessary because one can simply call new again with the new seed data periodically.
But he also provides a simple workaround:
o There is no way to clone a PRNG instance. Im not sure why this is might even be necessary or useful. File a bug report with an explanation why and Ill consider adding it to the next release.
Please report any bugs or feature requests on the bugtracker website http://rt.cpan.org/NoAuth/Bugs.html?Dist=Math-Random-ISAAC
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Jonathan Yu <email@example.com>
Legally speaking, this package and its contents are:
Copyright (c) 2011 by Jonathan Yu <firstname.lastname@example.org>.
But this is really just a legal technicality that allows the author to offer this package under the public domain and also a variety of licensing options. For all intents and purposes, this is public domain software, which means you can do whatever you want with it.
The software is provided AS IS, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
|perl v5.20.3||MATH::RANDOM::ISAAC (3)||2011-02-18|