PRSG - Perl interface to pseudo random sequence generator function.
use Math::PRSG;
This perl extension implements a (159, 31, 0) LFSR, giving a period of 160 bits. This can then be used as a RNG if seeded well (ie. with 160 bits of entropy) and if the output is fed through a message digest function (in order to prevent any prediction).
my $prsg = new PRSG $seed;
Create a new PRSG object. A 160 bit (20-byte) $seed must be provided, which is used to seed the LFSR.
$prsg->seed($rnd);
Seed the LFSR with $rnd.
$value = $prsg->clock();
Clock the LFSR, returning the new register value as a 20-byte string.
Systemics Ltd ( http://www.systemics.com/ )
To install Math::PRSG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::PRSG
CPAN shell
perl -MCPAN -e shell install Math::PRSG
For more information on module installation, please visit the detailed CPAN module installation guide.