ganeti

Safe HaskellSafe

Ganeti.Utils.Random

Description

Utilities related to randomized computations.

Synopsis

Documentation

generateSecret :: RandomGen g => Int -> g -> (String, g) Source #

Generates a random secret of a given length. The type is chosen so that it can be easily wrapped into a state monad.

generateOneMAC :: RandomGen g => String -> g -> (String, g) Source #

Given a prefix, randomly generates a full MAC address.

See generateMAC for discussion about how this function uses the random generator.

delayRandom :: (Int, Int) -> IO () Source #

Wait a time period randomly chosen within the given bounds (in microseconds).