Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class Monad m => CryptoRNG m where
- randomBytes :: Int -> m ByteString
- random :: Uniform a => m a
- randomR :: UniformRange a => (a, a) -> m a
Documentation
class Monad m => CryptoRNG m where Source #
Monads carrying around the RNG state.
randomBytes :: Int -> m ByteString Source #
Generate a given number of cryptographically secure random bytes.
random :: Uniform a => m a Source #
Generate a cryptographically secure value uniformly distributed over all possible values of that type.
randomR :: UniformRange a => (a, a) -> m a Source #
Generate a cryptographically secure value in a given, closed range.
Instances
(Monad (t m), MonadTrans t, CryptoRNG m) => CryptoRNG (t m) Source # | Generic, overlapping instance. |
Defined in Crypto.RNG.Class randomBytes :: Int -> t m ByteString Source # random :: Uniform a => t m a Source # randomR :: UniformRange a => (a, a) -> t m a Source # | |
MonadIO m => CryptoRNG (CryptoRNGT m) Source # | |
Defined in Crypto.RNG randomBytes :: Int -> CryptoRNGT m ByteString Source # random :: Uniform a => CryptoRNGT m a Source # randomR :: UniformRange a => (a, a) -> CryptoRNGT m a Source # | |
MonadIO m => CryptoRNG (RNGT m) Source # | |
Defined in Crypto.RNG.Unsafe |