Theo Schlossnagle

NAME

Mcrypt - Perl extension for a Mersenne Twister PRGN implementation with context.

SYNOPSIS

  use Rand::MersenneTwister;

  # Object-oriented methods

  # New object context optionally seeded.
  $r = Rand::MersenneTwister->new( [$seed] );
  
  # Seed or reseed this PRNG context.
  $r->seed($number); 

  # fetch the next random number in the sequance.
  # between 0 and 1
  my $random_number = $r->rand;
  # between 0 and $v
  my $random_number = $r->rand($v);

  # If the $r goes out of context, it is freed.

DESCRIPTION

This module wraps a fast, C implementation of a Mersenne Twister-based PRNG. =head1 Exported constants

The predefined groups of exports in the use statements are as follows:

use Rand::MersenneTwister;

Exports the following functions: mt_init, mt_free, mt_seed, mt_rand.

EXAMPLES

    use Rand::MersenneTwister;

    my $r = Rand::MersenneTwister->new();
    $r->seed();
    my $randmon_number = $r->rand(100);

AUTHOR

George Schlossnagle <george@omniti.com> Theo Schlossnagle <jesus@omniti.com>

SEE ALSO

http://www.math.keio.ac.jp/~matumoto/mt.html

For the less worldly:

http://www.math.keio.ac.jp/~matumoto/emt.html