Crypt:...:Source(3pm)
π Crypt::Random::Source β the manual, but make it cute π
okay bestie, so this is a User Contributed Perl Documentation page for Crypt::Random::Source(3pm) and honestly? it's giving "tiny module, big opinions." let's get into it π«Ά
β¨ NAME β¨
Crypt::Random::Source β get weak or strong random data from pluggable sources π
πΈ VERSION πΈ
version 0.14
β SYNOPSIS β
use Crypt::Random::Source qw(get_strong);
# get 10 cryptographically strong random bytes from an available source
my $bytes = get_strong(10);
like. that's it. ten bytes. cryptographically strong. we love a low-effort high-security moment π
π¦ DESCRIPTION π¦
This module provides implementations for a number of byte oriented sources of random data. β¨
See Crypt::Random::Source::Factory for a more powerful way to locate sources, and the various sources for specific implementations. iykyk π
π EXPORTS π
getget_weakget_strong
These functions delegate to a source chosen by an instance of Crypt::Random::Source::Factory, calling get. no cap, that's literally the whole thing β the factory picks the source, the function calls get on it. slay.
π CAVEATS π
β οΈ okay this part is lowkey important so pay attention bestie β οΈ
In versions prior to 0.13, "rand" could be used as a result of calling "get_weak", or "get", if no random device was available. This implies that not explicitly asking for "get_strong" on a non POSIX operating system (e.g. Win32 without the Win32 backend) could have resulted in non cryptographically random data. π like. that's the whole point of the module. gone. reduced to atoms.
Relatedly, the characterization of "urandom" as a weak source of randomness is also largely a misconception, see <https://www.2uo.de/myths-about-urandom/> for example. π§ (yes it's a URL, no I can't make it a link, terminal rules are terminal rules, go read it though, it eats.)
π SEE ALSO π
- Crypt::Random
- Crypt::Util
π SUPPORT π
Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Crypt-Random-Source> (or bug-Crypt-Random-Source@rt.cpan.org <mailto:bug-Crypt-Random-Source@rt.cpan.org>).
like, if something's broken, tell the tracker, don't just suffer in silence. the vibes will be better for everyone π«Ά
β¨ AUTHOR β¨
XXXX XXX'XX (Yuval Kogman) <nothingmuch@woobling.org>
π CONTRIBUTORS π
- Karen Etheridge <ether@cpan.org>
- Florian Ragwitz <rafl@debian.org>
- Graham Knop <haarg@haarg.org>
- David Pottage <spudsoup@cpan.org>
- Max Kanat-Alexander <mkanat@es-compy.(none)>
- Edward Betts <edward@4angle.com>
the whole squad showed up and honestly? iconic. π
π COPYRIGHT AND LICENCE π
This software is copyright (c) 2008 by Yuval Kogman.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the tea β β this page came from perl v5.34.0 and it was dated 2022-04-09, so if you're reading it in the far-flung future, hi, hope the random bytes are still random πβ¨π¦
π¦ where this page comes from
- debian bookworm: libcrypt-random-source-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcrypt-random-source-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcrypt-random-source-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libcrypt-random-source-perl 0.14-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms