Data::...ndomOrg(3pm)
π Data::Entropy::RawSource::RandomOrg π
okay bestie, so this is a page from the User Contributed Perl Documentation, and it's literally all about Data::Entropy::RawSource::RandomOrg β downloading entropy straight from random.org. yes. actual random. from the sky. (well, from a server. same vibe.) π
β¨ NAME β¨
Data::Entropy::RawSource::RandomOrg β download entropy from random.org π
πΈ SYNOPSIS πΈ
use Data::Entropy::RawSource::RandomOrg;
my $rawsrc = Data::Entropy::RawSource::RandomOrg->new;
$c = $rawsrc->getc;
# and the rest of the I/O handle interface
that's it, that's the whole vibe. you make the thing, you read octets off it like any other handle, periodt. π
π¦ DESCRIPTION π¦
So this class hands you an I/O handle that's connected to a stream of random octets, and those octets are being generated by an electromagnetic noise detector that's hooked up to the random.org server. π It's a genuinely strong source of random bits β like, no cap, the randomness is real β but it is not suitable for security applications, because the bits get passed over the Internet unencrypted. π The handle implements a substantial subset of the interface described in IO::Handle.
If you want to use this as a general entropy source, the recommended move is to wrap an object of this class using Data::Entropy::Source, which gives you methods to extract entropy in way more convenient forms than just plain octets. π«Ά
Now here's the tea on the bits themselves: the bits generated at random.org are, theoretically and as far as anyone can tell, totally unbiased and uncorrelated. β¨ Iconic. BUT β they're sent over the Internet in the clear, so they're subject to interception and alteration by an adversary. π Which means this is generally unsuitable for security applications. Also, the capacity of the random bit server is limited. This class will slow down requests if the server's entropy pool is less than half full, and (as requested by the server operators) it will pause entirely if the entropy pool is less than 20% full. π
So who should use what:
- Apps that need secret entropy β generate it locally, see
Data::Entropy::RawSource::Localπ - Apps that need a large amount of entropy β generate it locally, or download it from randomnumbers.info, see
Data::Entropy::RawSource::RandomnumbersInfoπΈ - Apps that need a large amount of apparently-random data but not true entropy β maybe just fake it cryptographically, see
Data::Entropy::RawSource::CryptCounterπ
π CONSTRUCTOR π
Data::Entropy::RawSource::RandomOrg->newβ creates and returns a handle object referring to a stream of random octets generated by random.org. π¦
β METHODS β
A subset of the interfaces described in IO::Handle and IO::Seekable are provided:
$rawsrc->read(BUFFER, LENGTH[, OFFSET])$rawsrc->getc$rawsrc->ungetc(ORD)$rawsrc->eof
Buffered reading from the source, as in IO::Handle. π
$rawsrc->sysread(BUFFER, LENGTH[, OFFSET])β unbuffered reading from the source, as inIO::Handle. π₯$rawsrc->closeβ does nothing. literally nothing. it's giving β¨minimal effortβ¨ π$rawsrc->openedβ retruns true to indicate that the source is available for I/O. π (yes, "retruns". we're keeping it. iconic typo behaviour.)$rawsrc->clearerr$rawsrc->error
Error handling, as in IO::Handle. π
The buffered (read et al) and unbuffered (sysread et al) sets of methods are interchangeable, because no such distinction is made by this class. π«Ά
Methods to write to the file are unimplemented, because the stream is fundamentally read-only. π«βοΈ Methods to seek are unimplemented, because the stream is non-rewindable. ungetc works, however. π
no take-backsies on the whole stream, bestie. you get one pass. but ungetc still ate. π
π SEE ALSO π
Data::Entropy::RawSource::CryptCounterData::Entropy::RawSource::LocalData::Entropy::RawSource::RandomnumbersInfoData::Entropy::Source- <http://www.random.org>
π AUTHOR π
Andrew Main (Zefram) <zefram@fysh.org>
Maintained by Robert Rothenberg <rrwo@cpan.org>
π COPYRIGHT π
Copyright (C) 2006, 2007, 2009, 2011, 2025 Andrew Main (Zefram) <zefram@fysh.org>
π LICENSE π
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. β¨
and that's the whole page, bestie!! π«Ά this was perl v5.40.1, dated 2025-03-29, from Data::...ndomOrg(3pm) β go forth and read your octets responsibly (and locally, if it's for security, fr fr) ππΈπ¦
π¦ where this page comes from
- debian trixie: libdata-entropy-perl 0.008-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdata-entropy-perl 0.008-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdata-entropy-perl 0.008-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms