License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | Good |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class Monad m => MonadRandom m where
- getRandomBytes :: ByteArray byteArray => Int -> m byteArray
- data MonadPseudoRandom gen a
- class DRG gen where
- randomBytesGenerate :: ByteArray byteArray => Int -> gen -> (byteArray, gen)
- withDRG :: DRG gen => gen -> MonadPseudoRandom gen a -> (a, gen)
Documentation
class Monad m => MonadRandom m where #
A monad constraint that allows to generate random bytes
getRandomBytes :: ByteArray byteArray => Int -> m byteArray #
Instances
MonadRandom IO # | |
Defined in Crypto.Random.Types getRandomBytes :: ByteArray byteArray => Int -> IO byteArray # | |
DRG gen => MonadRandom (MonadPseudoRandom gen) # | |
Defined in Crypto.Random.Types getRandomBytes :: ByteArray byteArray => Int -> MonadPseudoRandom gen byteArray # |
data MonadPseudoRandom gen a #
A simple Monad class very similar to a State Monad with the state being a DRG.
Instances
A Deterministic Random Generator (DRG) class
randomBytesGenerate :: ByteArray byteArray => Int -> gen -> (byteArray, gen) #
Generate N bytes of randomness from a DRG
Instances
DRG SystemDRG # | |
Defined in Crypto.Random.SystemDRG | |
DRG ChaChaDRG # | |
Defined in Crypto.Random.ChaChaDRG |
withDRG :: DRG gen => gen -> MonadPseudoRandom gen a -> (a, gen) #
Run a pure computation with a Deterministic Random Generator
in the MonadPseudoRandom