1Crypt::PRNG::Fortuna(3)User Contributed Perl DocumentatioCnrypt::PRNG::Fortuna(3)
2
3
4

NAME

6       Crypt::PRNG::Fortuna - Cryptographically secure PRNG based on Fortuna
7       algorithm
8

SYNOPSIS

10          ### Functional interface:
11          use Crypt::PRNG::Fortuna qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u
12                                      random_string random_string_from rand irand);
13
14          $octets = random_bytes(45);
15          $hex_string = random_bytes_hex(45);
16          $base64_string = random_bytes_b64(45);
17          $base64url_string = random_bytes_b64u(45);
18          $alphanumeric_string = random_string(30);
19          $string = random_string_from('ACGT', 64);
20          $floating_point_number_0_to_1 = rand;
21          $floating_point_number_0_to_88 = rand(88);
22          $unsigned_32bit_int = irand;
23
24          ### OO interface:
25          use Crypt::PRNG::Fortuna;
26
27          $prng = Crypt::PRNG::Fortuna->new;
28          #or
29          $prng = Crypt::PRNG::Fortuna->new("some data used for seeding PRNG");
30
31          $octets = $prng->bytes(45);
32          $hex_string = $prng->bytes_hex(45);
33          $base64_string = $prng->bytes_b64(45);
34          $base64url_string = $prng->bytes_b64u(45);
35          $alphanumeric_string = $prng->string(30);
36          $string = $prng->string_from('ACGT', 64);
37          $floating_point_number_0_to_1 = rand;
38          $floating_point_number_0_to_88 = rand(88);
39          $unsigned_32bit_int = irand;
40

DESCRIPTION

42       Provides an interface to the Fortuna based pseudo random number
43       generator
44
45       All methods and functions are the same as for Crypt::PRNG.
46

FUNCTIONS

48   random_bytes
49       See "random_bytes" in Crypt::PRNG.
50
51   random_bytes_hex
52       See "random_bytes_hex" in Crypt::PRNG.
53
54   random_bytes_b64
55       See "random_bytes_b64" in Crypt::PRNG.
56
57   random_bytes_b64u
58       See "random_bytes_b64u" in Crypt::PRNG.
59
60   random_string
61       See "random_string" in Crypt::PRNG.
62
63   random_string_from
64       See "random_string_from" in Crypt::PRNG.
65
66   rand
67       See "rand" in Crypt::PRNG.
68
69   irand
70       See "irand" in Crypt::PRNG.
71

METHODS

73   new
74       See "new" in Crypt::PRNG.
75
76   bytes
77       See "bytes" in Crypt::PRNG.
78
79   bytes_hex
80       See "bytes_hex" in Crypt::PRNG.
81
82   bytes_b64
83       See "bytes_b64" in Crypt::PRNG.
84
85   bytes_b64u
86       See "bytes_b64u" in Crypt::PRNG.
87
88   string
89       See "string" in Crypt::PRNG.
90
91   string_from
92       See "string_from" in Crypt::PRNG.
93
94   double
95       See "double" in Crypt::PRNG.
96
97   int32
98       See "int32" in Crypt::PRNG.
99

SEE ALSO

101       •   Crypt::PRNG
102
103       •   <https://en.wikipedia.org/wiki/Fortuna_%28PRNG%29>
104
105
106
107perl v5.34.0                      2021-07-22           Crypt::PRNG::Fortuna(3)
Impressum