1package Crypt::Perl::RNG;
2
3use strict;
4use warnings;
5
6use Bytes::Random::Secure::Tiny ();
7
8my %PID_RNG;
9
10sub _get {
11    return $PID_RNG{$$} ||= Bytes::Random::Secure::Tiny->new();
12}
13
14sub bytes {
15    return _get()->bytes(@_);
16}
17
18sub bytes_hex {
19    return _get()->bytes_hex(@_);
20}
21
22sub bit_string {
23    my ($count) = @_;
24
25    return _get()->string_from('01', $count);
26}
27
281;
29