Crypt::...Sober128(3)
π Crypt::PRNG::Sober128 β Sober128 PRNG, bestie edition π
okay so this is a User Contributed Perl Documentation page, the manual name is Crypt::...Sober128(3) (yes bestie, with the lil dots, iykyk β¨), and the whole page is about Crypt::PRNG::Sober128. It's giving secure random vibes, and I'm obsessed.
πΈ NAME πΈ
Crypt::PRNG::Sober128 β a cryptographically secure PRNG based on the Sober128 (stream cipher) algorithm. periodt. π
β¨ SYNOPSIS β¨
Functional interface first, because we love a functional bestie:
### Functional interface:
use Crypt::PRNG::Sober128 qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand);
my $octets = random_bytes(45);
my $hex_string = random_bytes_hex(45);
my $base64_string = random_bytes_b64(45);
my $base64url_string = random_bytes_b64u(45);
my $alphanumeric_string = random_string(30);
my $string = random_string_from('ACGT', 64);
my $floating_point_number_0_to_1 = rand;
my $floating_point_number_0_to_88 = rand(88);
my $unsigned_32bit_int = irand;
and now the OO interface, main character energy:
### OO interface:
use Crypt::PRNG::Sober128;
my $prng = Crypt::PRNG::Sober128->new;
my $seeded_prng = Crypt::PRNG::Sober128->new("some data used for seeding PRNG");
my $octets = $prng->bytes(45);
my $hex_string = $prng->bytes_hex(45);
my $base64_string = $prng->bytes_b64(45);
my $base64url_string = $prng->bytes_b64u(45);
my $alphanumeric_string = $prng->string(30);
my $string = $prng->string_from('ACGT', 64);
my $floating_point_number_0_to_1 = $prng->double;
my $floating_point_number_0_to_88 = $prng->double(88);
my $unsigned_32bit_int = $prng->int32;
π¦ DESCRIPTION π¦
This module gives you an interface to the Sober128-based pseudo-random number generator. lowkey it's a thin wrapper around Crypt::PRNG, except the algorithm is fixed to Sober128. no cap.
All functions and methods accept the same arguments and return the same values as the corresponding Crypt::PRNG entries. so if you already know Crypt::PRNG, you're basically home, bestie π«Ά
π EXPORT π
Nothing is exported by default. nothing. zero. zilch. π
You can export selected functions:
use Crypt::PRNG::Sober128 qw(random_bytes random_string);
Or all of them at once, because sometimes you just want the whole vibe:
use Crypt::PRNG::Sober128 ':all';
π FUNCTIONS π
All functions below behave exactly like the corresponding Crypt::PRNG functions, but they use a hidden "Crypt::PRNG::Sober128" object internally. sneaky but iconic. π
π random_bytes π
See "random_bytes" in Crypt::PRNG.
π random_bytes_hex π
See "random_bytes_hex" in Crypt::PRNG.
π random_bytes_b64 π
See "random_bytes_b64" in Crypt::PRNG.
π random_bytes_b64u π
See "random_bytes_b64u" in Crypt::PRNG.
π random_string π
See "random_string" in Crypt::PRNG.
π random_string_from π
See "random_string_from" in Crypt::PRNG.
π rand π
See "rand" in Crypt::PRNG.
π irand π
See "irand" in Crypt::PRNG.
π METHODS π
Unless noted otherwise, assume $prng is an existing "Crypt::PRNG::Sober128" object created via "new". got it? good. π«Ά
π§ new π§
my $prng = Crypt::PRNG::Sober128->new;
my $seeded_prng = Crypt::PRNG::Sober128->new($seed);
Creates a PRNG object using the Sober128 algorithm. If $seed is omitted, the object is automatically seeded by the underlying Crypt::PRNG logic. cute and convenient. β¨
π§ bytes π§
See "bytes" in Crypt::PRNG.
π§ bytes_hex π§
See "bytes_hex" in Crypt::PRNG.
π§ bytes_b64 π§
See "bytes_b64" in Crypt::PRNG.
π§ bytes_b64u π§
See "bytes_b64u" in Crypt::PRNG.
π§ string π§
See "string" in Crypt::PRNG.
π§ string_from π§
See "string_from" in Crypt::PRNG.
π§ double π§
See "double" in Crypt::PRNG.
π§ int32 π§
See "int32" in Crypt::PRNG.
β SEE ALSO β
Crypt::PRNGβ the parent-ish bestie, go read it π- <https://en.wikipedia.org/wiki/SOBER-128> β the wiki lore for Sober128 π
okay that's the whole page bestie. the footer vibes are: perl v5.42.0, dated 2026-05-11, and the manual name is Crypt::...Sober128(3). mwah ππ
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-CryptX 0.89.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-CryptX 0.89.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-CryptX 0.89.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-CryptX 0.89.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms