You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Crypt::OpenSSL::Random](https://metacpan.org/pod/Crypt::OpenSSL::Random) will return bytes from OpenSSL or LibreSSL libraries' pseudo-random number generators.
169
+
170
+
use Crypt::OpenSSL::Random qw( random_bytes );
171
+
172
+
my $bytes = random_bytes(32)
173
+
or die "not enough randomness";
174
+
175
+
This module requires the OpenSSL or LibreSSL libraries to be installed, which may make it non-portable.
176
+
177
+
Note that on systems without `/dev/random` device, the random seed may need to be initialised.
178
+
(There is a `random_status` function that indicates whether there is sufficient seeding.)
179
+
166
180
## Generating IDs, Tokens and Passwords
167
181
168
182
When generating raw random data for encryption keys or initialisation vectors, a common need is to generate a
0 commit comments