Data::...ersInfo(3pm)
πΈ NAME πΈ
Data::Entropy::RawSource::RandomnumbersInfo β download entropy from randomnumbers.info π
okay so bestie, welcome to the Data::...ersInfo(3pm) man page, this one is SO fun, we're literally pulling real random bits off the internet from a quantum computer, no cap π
β¨ SYNOPSIS β¨
use Data::Entropy::RawSource::RandomnumbersInfo;
my $rawsrc = Data::Entropy::RawSource::RandomnumbersInfo->new;
$c = $rawsrc->getc;
# and the rest of the I/O handle interface
π¦ DESCRIPTION π¦
So this class hands you an I/O handle that's wired up to a stream of random octets, and those octets are being generated by a quantum random number generator β from the company id Quantique β which is plugged into the randomnumbers.info server at the University of Geneva. Iconic. It's a strong source of random bits, but ngl it is not suitable for security applications, because the bits are 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 move is to wrap an object of this class using "Data::Entropy::Source" β that gives you methods to extract entropy in way more convenient forms than mere octets. Obsessed, honestly. π«Ά
The bits generated at randomnumbers.info are, theoretically and as far as anyone can tell, totally unbiased and uncorrelated. Like, chef's kiss. BUT β and this is the part we do not skip β they are sent over the Internet in the clear, so they're subject to interception and alteration by an adversary. So this is therefore generally unsuitable for security applications. π¨ Applications that require secret entropy should generate it locally (see Data::Entropy::RawSource::Local). Applications that require a large amount of apparently-random data, but not true entropy, might prefer to fake it cryptographically (see Data::Entropy::RawSource::CryptCounter). Pick your fighter π
π« CONSTRUCTOR π«
Data::Entropy::RawSource::RandomnumbersInfo->newβ creates and returns a handle object referring to a stream of random octets generated byrandomnumbers.info. That's it, that's the whole vibe β¨
π 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 "I'm just here for the vibes" π$rawsrc->openedβ returns true to indicate that the source is available for I/O.$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. Slay, no drama. π
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. π
π SEE ALSO π
Data::Entropy::RawSource::CryptCounterData::Entropy::RawSource::LocalData::Entropy::RawSource::RandomOrgData::Entropy::Source<http://www.randomnumbers.info>
π 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, go forth and gather your quantum randomness responsibly (but not for secrets, fr fr) π§π
perl v5.40.1 Β· 2025-03-29 Β· Data::...ersInfo(3pm) β mwah, ty for reading, ily, bye π
β¨
π¦ 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