.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Math::RandomOrg 3pm" .TH Math::RandomOrg 3pm "2006-11-27" "perl v5.18.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Math::RandomOrg \- Retrieve random numbers and data from random.org. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use Math::RandomOrg qw(randnum randbyte); \& my $number = randnum(0, 10); \& my $octet = randbyte(1); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" 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 \f(CW\*(C`randnum\*(C'\fR and \f(CW\*(C`randbyte\*(C'\fR functions respectively. .SH "REQUIRES" .IX Header "REQUIRES" .IP "Carp" 4 .IX Item "Carp" .PD 0 .IP "Exporter" 4 .IX Item "Exporter" .IP "Math::BigInt" 4 .IX Item "Math::BigInt" .IP "LWP::Simple" 4 .IX Item "LWP::Simple" .PD .SH "EXPORT" .IX Header "EXPORT" None by default. You may request the following symbols be exported: .IP "\(bu" 4 randnum .IP "\(bu" 4 randbyte .SH "FUNCTIONS" .IX Header "FUNCTIONS" .ie n .IP """checkbuf()""" 4 .el .IP "\f(CWcheckbuf()\fR" 4 .IX Item "checkbuf()" This routine takes no parameters and simply returns a single value (e.g., \&\f(CW\*(C`28%\*(C'\fR) 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. .ie n .IP """randnum ( $min, $max )""" 4 .el .IP "\f(CWrandnum ( $min, $max )\fR" 4 .IX Item "randnum ( $min, $max )" Return an integer (specifically a Math::BigInt object) between the bounds [ \f(CW$min\fR, \f(CW$max\fR ] (inclusive). .Sp By default, \f(CW$max\fR and \f(CW$min\fR are positive and negative 1e9, respectively. These default values represent random.org's current extrema for the bounds of the randnum function. Therefore, \f(CW$min\fR and \f(CW$max\fR may not exceed the default values. .ie n .IP """randbyte ( $length )""" 4 .el .IP "\f(CWrandbyte ( $length )\fR" 4 .IX Item "randbyte ( $length )" Returns an octet-string of specified length (defaults to one byte), which contains random bytes. .Sp \&\f(CW$length\fR 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. .ie n .IP """randseq ( $min, $max )""" 4 .el .IP "\f(CWrandseq ( $min, $max )\fR" 4 .IX Item "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. .Sp Example: \f(CW\*(C`randseq(1, 10)\*(C'\fR will return the numbers between 1 and 10 (both inclusive) in a random order. .SH "BUGS" .IX Header "BUGS" None known. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 Math::TrulyRandom .IP "\(bu" 4 rand .SH "COPYRIGHT" .IX Header "COPYRIGHT" 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. .SH "AUTHOR" .IX Header "AUTHOR" Gregory Todd Williams \f(CW\*(C`\*(C'\fR