The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Crypt::PRNG::Fortuna - Cryptographically secure PRNG based on Fortuna algorithm

SYNOPSIS

   ### Functional interface:
   use Crypt::PRNG::Fortuna qw(random_bytes random_bytes_hex random_bytes_b64 random_string random_string_from rand irand);

   $octets = random_bytes(45);
   $hex_string = random_bytes_hex(45);
   $base64_string = random_bytes_b64(45);
   $alphanumeric_string = random_string(30);
   $string = random_string_from('ACGT', 64);
   $floating_point_number_0_to_1 = rand;
   $floating_point_number_0_to_88 = rand(88);
   $unsigned_32bit_int = irand;

   ### OO interface:
   use Crypt::PRNG::Fortuna;

   $prng = Crypt::PRNG::Fortuna->new;
   #or
   $prng = Crypt::PRNG::Fortuna->new("some data used for seeding PRNG");
   
   $octets = $prng->bytes(45);
   $hex_string = $prng->bytes_hex(45);
   $base64_string = $prng->bytes_b64(45);
   $alphanumeric_string = $prng->string(30);
   $string = $prng->string_from('ACGT', 64);
   $floating_point_number_0_to_1 = rand;
   $floating_point_number_0_to_88 = rand(88);
   $unsigned_32bit_int = irand;

DESCRIPTION

Provides an interface to the Fortuna based pseudo random number generator

All methods and functions are the same as for Crypt::PRNG.

FUNCTIONS

random_bytes

random_bytes_hex

random_bytes_b64

random_string

random_string_from

rand

irand

METHODS

new

bytes

bytes_hex

bytes_b64

string

string_from

double

int32

SEE ALSO

Crypt::PRNG