Class RFuzz::RandomGenerator
In: lib/rfuzz/random.rb
Parent: Object

Methods

base64   byte_array   bytes   floats   hash_of   headers   ints   new   num   queries   uris   words  

Public Class methods

Either initialized without a word dictionary or with one. If you initialize with a word dictionary then you can generate the random words, and is the expected behavior. You can use the "type" parameter to change the default type of generated content from words to any of the other types available [:base64,:uris,:byte_array,:ints,:floats].

The dict should just be an array of words.

Public Instance methods

Generates an array of base64 encoded chunks of garbage. The length=100 is the default and is a max, but the lengths are random.

Generates an array of garbage byte strings, these are binary strings so very nasty. As usual, length=100 is a max for the random lengths.

Generate a single String with random binary garbage in it.

An array for random floats.

Returns a random hash of type (default :words) where the key=>value is randomly generated. This is aliased for RandomGenerator.queries and RandomGenerator.headers so that it is more readable.

:words,:base64,:uris,:byte_array,:ints,:floats
are the available

types of generated hash garbage you can use. These "types" just translate to function calls on self.send(type,length).

headers(count,length=5,type=@type)

Alias for hash_of

An array of integers with a default max of max. The integers are 4 bytes and pulled from network encoding so they should be cross platform (meaning tests should run the same on all platforms).

A random number with a maximum of max.

queries(count,length=5,type=@type)

Alias for hash_of

Generate an array of random length URIs based on words from the dict. The default max length=100 and is the number of words to chain together into a gigantor URI. The URI starts with /.

Generates an array with count number of randomly selected words from the dictionary.

[Validate]