HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/doc/libbytes-random-secure-perl/examples/random-sha512.pl
use strict;
use warnings;
use Bytes::Random::Secure qw( random_bytes );
use Digest::SHA qw( sha512_base64 );

my $quantity = 128;

# Get a string of 128 random bytes.
my $bytes    = random_bytes($quantity);

# And just for fun, generate a base64 encoding of a sha2-512 digest of the
# random byte string.
my $digest   = sha512_base64( $bytes );

print "$digest\n";