Math::RandomOrg(3pm)

πŸ“¦
version 0.04 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Math::RandomOrg πŸ’–

okay bestie, so this is Math::RandomOrg β€” it pulls random numbers and random data straight off the random.org server. yes. the actual atmospheric-noise-randomness people. no cap. πŸŽ€

It lives in the Perl docs, and honestly? it's giving "tiny module, huge vibes."


✨ SYNOPSIS ✨

use Math::RandomOrg qw(randnum randbyte);
my $number = randnum(0, 10);
my $octet = randbyte(1);

that's it. that's the whole entrance. two functions, one use line, we're off to the races πŸ¦‹


🌸 DESCRIPTION 🌸

So Math::RandomOrg gives you functions for grabbing random data from the random.org server. You can get that data in two whole flavors: integer format or byte-stream format, using the randnum and randbyte functions respectively. Ivy League honestly. πŸ’…


🫢 REQUIRES 🫢

these are the modules it needs to even function, bestie, don't @ me:

  • Carp
  • Exporter
  • Math::BigInt
  • LWP::Simple

πŸ‘‘ EXPORT πŸ‘‘

None by default. like, zero, nada, nothing comes out unless you ask for it. You may request these symbols be exported:

  • randnum
  • randbyte

so go ahead and put them in your qw( ... ) list, main character behavior only. ✨


πŸ’… FUNCTIONS πŸ’…

checkbuf()

This routine takes no parameters and simply returns a single value (e.g., "28%") that tells you how full the buffer is. πŸ“Š

  • At 100%, the buffer is full and you are free to hit it with automated clients. go wild, periodt.
  • At 0%, the buffer is empty and requests will hang. 😭 not the hang.
  • When less than 100%, the buffer is being filled continually, but doing so takes time.

I advise people with automated clients to check the buffer level every once in a while and only issue requests when the buffer level is 20% or higher. fr fr, this is the good-guest rule.

randnum ( $min, $max )

Return an integer (specifically a Math::BigInt object) between the bounds [ $min, $max ] (inclusive). both ends included, we love an inclusive queen. πŸ’–

By default, $max and $min are positive and negative 1e9, respectively. These default values represent random.org's current extrema for the bounds of the randnum function. Therefore, $min and $max may not exceed the default values. 🚫

randbyte ( $length )

Returns an octet-string of specified length (defaults to one byte), which contains random bytes. one byte is the default, so if you're lazy you still get something, iconic. 🌈

$length may not exceed 16,384, as this is the maximum number of bytes retrievable from the random.org server in one request, and making multiple requests for an unbounded amount of data would unfairly tax the random.org server. be nice to the server bestie, it's doing its best. πŸ₯Ί

If you need large amounts of random data, you may wish to try the Math::TrulyRandom module.

randseq ( $min, $max )

The randseq script returns a randomized sequence of numbers. This corresponds to dropping a number of lottery tickets into a hat and drawing them out in random order. 🎟️🎩 Hence, each number in a randomized sequence occurs exactly once. no dupes, no repeats, we said what we said.

Example: randseq(1, 10) will return the numbers between 1 and 10 (both inclusive) in a random order.


πŸ’€ BUGS πŸ’€

None known. flawless, unproblematic, no notes. πŸ™ˆ


🌟 SEE ALSO 🌟

  • Math::TrulyRandom
  • rand

Copyright (c) 2001-2006 Gregory Todd Williams. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


🧚 AUTHOR 🧚

Gregory Todd Williams "<gwilliams@cpan.org>"


and that's the whole thing, bestie!! this page is from perl v5.36.0, dated 2022-10-13, and you read the Math::RandomOrg(3pm) manual page top to bottom. πŸ’œ go generate something random, you earned it. slay. βœ¨πŸ¦‹πŸ“

πŸ“¦ where this page comes from