1Crypt::PRNG::RC4(3)   User Contributed Perl Documentation  Crypt::PRNG::RC4(3)
2
3
4

NAME

6       Crypt::PRNG::RC4 - Cryptographically secure PRNG based on RC4 (stream
7       cipher) algorithm
8

SYNOPSIS

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

DESCRIPTION

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

FUNCTIONS

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

METHODS

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

SEE ALSO

99       •   Crypt::PRNG
100
101       •   <https://en.wikipedia.org/wiki/RC4_cipher>
102
103
104
105perl v5.38.0                      2023-10-04               Crypt::PRNG::RC4(3)
Impressum