aboutsummaryrefslogtreecommitdiffstats
path: root/random-passphrase
blob: 0bb2f02dccb38aa18e2937730dd0ca10d7fc2e72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl -w
use strict;

my $size = 100;

binmode(STDOUT, ":utf8");

open(my $rf, '<', '/dev/random');
while ($size) {
    my $o;
    print STDERR "$size random bytes to read.\n";
    read $rf, $o, 1;
    print unpack("H*", $o);
    $size--;
}
close($rf);