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 Source #
A monad constraint that allows to generate random bytes
getRandomBytes :: ByteArray byteArray => Int -> m byteArray Source #
Instances
MonadRandom IO Source # | |
Defined in Crypto.Random.Types |
|
DRG gen => MonadRandom ( MonadPseudoRandom gen) Source # | |
Defined in Crypto.Random.Types getRandomBytes :: ByteArray byteArray => Int -> MonadPseudoRandom gen byteArray Source # |
data MonadPseudoRandom gen a Source #
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) Source #
Generate N bytes of randomness from a DRG
Instances
DRG SystemDRG Source # | |
Defined in Crypto.Random.SystemDRG |
|
DRG ChaChaDRG Source # | |
Defined in Crypto.Random.ChaChaDRG |
withDRG :: DRG gen => gen -> MonadPseudoRandom gen a -> (a, gen) Source #
Run a pure computation with a Deterministic Random Generator
in the
MonadPseudoRandom