Random Value Generators

I would like to collect here a small set of random value generators that I use pretty often.

Integer

The following random value generator is for integer values. It returns a pseudorandom, uniformly distributed integer value between 0 (inclusive) and the Maximum Value (exclusive). The Number.MAX_SAFE_INTEGER will be used if Maximum Value is empty.

Float

An other random value generator for floating point numbers.

String

This random value generator is for strings. It will return a pseudorandom, uniformly distributed of the specified Length and contains only Allowed characters.

Color

This random value generator is for colors. It will return a pseudorandom, uniformly distributed color.

Next Previous