RANVAL(1)

NAME
ranval - generate random numbers

SYNOPSIS
ranval [-q | -c count] [ [-b] bound]

DESCRIPTION
ranval returns a random integer value between 0 and bound - 1, inclusive. The default value for bound is 4294967296 (2^32). By default, these values are written to stdout. ranval uses the arc4random(3) family of functions to provide good random numbers without a modulo bias.

The options are as follows:

-q  If the -q option is specified, instead of printing ranval returns a random exit value of 0 to bound - 1, inclusive. In this case, bound will be capped at 256.

-c count
    Generate count random numbers before exiting. Use 0 to produce random numbers until interrupted. By default, only 1 random number will be generated. Count is limited to 9223372036854775807 (2^63 - 1).

bound |
    -b bound Specify an upper bound. Random values between 0 and bound - 1, inclusive will be generated. This value must be between 1 (which results in debianesque randomness) and 4294967296 (the default). The bound can also be given in the environment variable RANVAL_BOUND. When both the environment variable is set and a bound is specified on the command line, the latter takes precendence.

SEE ALSO
arc4random(3)