Object Popcorn.Core.Random


object Popcorn.Core.Random
Random generator object. This object implements all Popcorn.Core.RandomLib generator functions.
Defined in Popcorn.Core

Function Summary
generator alpha(integer max)
generator alpha(integer min, integer max)
The range function 'alpha' generates a random alpha string.
generator alphaNum(integer max)
generator alphaNum(integer min, integer max)
Same as alpha but generates an alpha numeric string.
generator element(any[] as)
'element' picks a random element from provided argument array 'as'.
Random email address generator that uses names, surnames and domains dictionaries to generate email addresses of the form 'name.surname1@surname2.domain'.
generator int(integer max)
generator int(integer min, integer max)
A random integer generator.
generator ipAddress(string fromIP, string toIP)
Generates a random IP address string in the range from 'fromIP' to 'toIP'.
generator macAddress(string delimiter)
Generates a random mac address string.

Function Details

function alpha

generator alpha()
generator alpha(integer max)
generator alpha(integer min, integer max)
The range function 'alpha' generates a random alpha string. The length of the string depends on the arguments this function is called with.
Parameters:
No arguments - generates an alpha string of length between 0 and 100.
One int argument - generates an alpha string of length between 0 and 'max'.
max - max string length.
two int arguments - length range.
min - min length
max - max length
Defined in Popcorn.Common

function alphaNum

generator alphaNum()
generator alphaNum(integer max)
generator alphaNum(integer min, integer max)
Same as alpha but generates an alpha numeric string.
Parameters:
No arguments - generates an alphaNum string of length between 0 and 100.
One int argument - generates an alphaNum string of length between 0 and 'max'.
max - max string length.
two int arguments - length range.
min - min length
max - max length
Defined in Popcorn.Common

function element

generator element(any[] as)
'element' picks a random element from provided argument array 'as'.
Parameters:
as - array
Returns:
the element generator which executed returns a random element from argument array 'as'.

function emailAddress

generator emailAddress()
Random email address generator that uses names, surnames and domains dictionaries to generate email addresses of the form 'name.surname1@surname2.domain'.
Returns:
a random email address generator.
Defined in Popcorn.Network

function int

generator int()
generator int(integer max)
generator int(integer min, integer max)
A random integer generator. 'int' is a rage function that generates a value between min and max, depending on arguments the function is called with.
Parameters:
No arguments - the generator returns a random value between 0 and 100.
One int argument - the generator returns a random value between 0 and max.
max - max value.
Two int argument - the generator returns a random value between min and max.
min - from integer
max - to integer
Returns:
a generator which executed generates a random integer.

function ipAddress

generator ipAddress(string fromIP, string toIP)
Generates a random IP address string in the range from 'fromIP' to 'toIP'.
Parameters:
fromIP - IP string of the form '192.168.0.1'.
toIP - IP string of the form '192.168.0.10'.
Returns:
a random IP address generator.
Defined in Popcorn.Network

function macAddress

generator macAddress(string delimiter)
Generates a random mac address string. This generator accepts an optional delimiter char.
Parameters:
delimiter - an optional delimiter char.
Returns:
a random mac address generator.
Defined in Popcorn.Network