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 by randomnumbers.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 in IO::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::CryptCounter
  • Data::Entropy::RawSource::Local
  • Data::Entropy::RawSource::RandomOrg
  • Data::Entropy::Source
  • <http://www.randomnumbers.info>

πŸ‘‘ AUTHOR πŸ‘‘

Andrew Main (Zefram) <zefram@fysh.org>

Maintained by Robert Rothenberg <rrwo@cpan.org>


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