27 Nov 2006 18:52:51 UTC
- Distribution: Math-RandomOrg
- Module version: 0.04
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (3)
- Testers (315 / 219 / 0)
- KwaliteeBus factor: 1
- 45.04% Coverage
- License: perl_5
- Activity24 month
- Download (12.58KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Math::RandomOrg - Retrieve random numbers and data from random.org.
use Math::RandomOrg qw(randnum randbyte); my $number = randnum(0, 10); my $octet = randbyte(1);
Math::RandomOrg provides functions for retrieving random data from the random.org server. Data may be retrieved in an integer or byte-stream format using the
None by default. You may request the following symbols be exported:
This routine takes no parameters and simply returns a single value (e.g.,
28%) telling you how full the buffer is. At 100%, the buffer is full and you are free to hit it with automated clients. At 0%, the buffer is empty and requests will 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.
randnum ( $min, $max )
Return an integer (specifically a Math::BigInt object) between the bounds [ $min, $max ] (inclusive).
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.
$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. 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.
randseq(1, 10)will return the numbers between 1 and 10 (both inclusive) in a random order.
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.
Gregory Todd Williams
Module Install Instructions
To install Math::RandomOrg, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Math::RandomOrg
For more information on module installation, please visit the detailed CPAN module installation guide.