Crypt:...e::Base(3pm)
๐ Crypt::Random::Source::Base ๐
okay bestie, welcome to the abstract base class for all the Crypt::Random::Source classes โ she's the blueprint, the mother, the template, the it girl of random data. This is the 3pm manual page, and yes we're getting into it. ๐
โจ VERSION โจ
version 0.14 โ that's the one, no cap.
๐ธ SYNOPSIS ๐ธ
the vibe check in code form, literally just:
use Moo;
extends qw(Crypt::Random::Source::Base);
slay. that's it. that's the whole mood. ๐
๐ฆ DESCRIPTION ๐ฆ
So this is an abstract base class. You don't instantiate her directly, she's not a main character you can just call, she's the ancestor everybody else inherits from. Iconic behavior only. ๐
and likeโฆ plot twist for the future: she's going to be a role at some point. so jot that down. ๐ฎ
โจ METHODS โจ
get $n, %args
grabs $n random bytes and hands them back to you as a string. cute right?
โ ๏ธ but ngl, this one may produce fatal errors if the source couldn't give you enough data. like, the source literally could not serve. tragic. ๐
read $buf, $n, [ $off ]
okay so this method is cannibalized from IO::Scalar (she ate, fr fr) and it provides an IO::Handle work-alike. so you can treat it like an IO handle, iykyk. ๐ซถ
heads up: subclasses override this so they can operate on a real handle directly if one's available. different, but make it efficient. โจ
seed @stuff
on the sources that support it, this one adds @stuff โ whatever @stuff even is, no questions asked โ to the random seed. ๐ฑ
โ ๏ธ but some sources may not support this, so likeโฆ be careful. don't just assume. ๐
available
this is a class method! and when it returns true, calling new with no arguments on the class should give you a working source of random data. periodt.
also it's used by Crypt::Random::Source::Factory โ so she's doing the lord's work behind the scenes. ๐
rank
another class method, and she's got some futz value for a ranking. the whole point is helping the known-good sources get tried before the known-bad ones (aka the slower, less available ones). queen shit. ๐
get_data %Params
this one's just here for compatibility with Crypt::Random. she's a little throwback, we love her for that. ๐
๐ SUPPORT ๐
got bugs? bestie, please submit them through the RT bug tracker:
<https://rt.cpan.org/Public/Dist/Display.html?Name=Crypt-Random-Source>
or if you're feeling email-y:
<bug-Crypt-Random-Source@rt.cpan.org>
(that's the mailto: <bug-Crypt-Random-Source@rt.cpan.org> one, in case you were wondering) ๐
โญ AUTHOR โญ
XXXX XXX'XX (Yuval Kogman) <nothingmuch@woobling.org> โ shoutout to the legend. ๐ซก
๐ COPYRIGHT AND LICENCE ๐
This software is copyright (c) 2008 by Yuval Kogman.
and it's free software! you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so go off, respectfully. ๐
and that's the whole page bestie ๐ฆ โ this was perl v5.34.0, dated 2022-04-09, and the manual you just read was Crypt:...e::Base(3pm). love that for us. mwah. ๐โจ
๐ฆ 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