Class Crypt::ISAAC
In: lib/crypt-isaac.rb
Parent: Object

ISAAC is a fast, strong random number generator. Details on the algorithm can be found here: burtleburtle.net/bob/rand/isaac.html This provides a consistent and capable algorithm for producing independent streams of quality random numbers.

Methods

isaac   new   rand   randinit  

Attributes

aa  [RW] 
bb  [RW] 
cc  [RW] 
mm  [RW] 
randcnt  [RW] 
randrsl  [RW] 

Public Class methods

When a Crypt::ISAAC object is created, it needs to be seeded for random number generation. If the system has a /dev/urandom file, that will be used to do the seeding by default. If false is explictly passed when creating the object, it will instead use /dev/random to generate its seeds. Be warned that this may make for SLOW initialization. If the requested source (/dev/urandom or /dev/random) do not exist, the system will fall back to a simplistic initialization mechanism using the builtin Mersenne Twister PRNG.

Public Instance methods

Works just like the standard rand() function. If called with an integer argument, rand() will return positive random number in the range of 0 to (argument - 1). If called without an integer argument, rand() returns a positive floating point number less than 1.

[Validate]