raaz-0.0.2: The raaz cryptographic library.

Safe HaskellNone

Raaz.Core.Random

Synopsis

Documentation

class InfiniteSource prg => PRG prg whereSource

The class that captures pseudo-random generators. Essentially the a pseudo-random generator (PRG) is a byte sources that can be seeded.

Associated Types

type Seed prg :: *Source

Associated type that captures the seed for the PRG.

Methods

newPRG :: Seed prg -> IO prgSource

Creates a new pseudo-random generators

reseed :: Seed prg -> prg -> IO ()Source

Re-seeding the prg.

Instances

class Random r whereSource

Stuff that can be generated by a pseudo-random generator.

Methods

random :: PRG prg => prg -> IO rSource

Instances

data SystemPRG Source

The system wide pseudo-random generator. The source is expected to be of high quality, albeit a bit slow due to system call overheads. It is expected that this source is automatically seeded from the entropy pool maintained by the platform. Hence, it is neither necessary nor possible to seed this generator which reflected by the fact that the associated type Seed SystemPRG is the unit type ().