NAME

Net::OAuth2::Scheme::Random - random number generator interface

VERSION

version 0.03

SYNOPSIS

 # use something (defaults to Math::Random::MT::Auto)
 use Net::OAuth2::Scheme::Random;

 # use Mersenne Twister
 use Net::OAuth2::Scheme::Random 'Math::Random::MT::Auto';

 # use ISAAC;
 use Net::OAuth2::Scheme::Random 'Math::Random::ISAAC';

 $rng = Net::OAuth2::Scheme::Random->new
 $rng->bytes(24) # return 24 random octets

DESCRIPTION

This provides an interface for using arbitrary random number generator classes with Net::OAuth2::Scheme.

The generator is instantiated exactly once in each thread/interpreter using the same randomly derived seed, the process ID, the interpreter ID and the thread/interpreter-start time. Repeated calls to new() in the same thread/interpreter will simply return the same generator.

CONSTRUCTOR

$class->new()
$class->new($rng_class)

Return the generator derived from the default class / $rng_class as instantiated for this thread/interpreter.

METHODS

bytes($n)

Return a random string of $n octets.

AUTHOR

Roger Crew <crew@cs.stanford.edu>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Roger Crew.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.