crypto-rng-0.3.0.1: Cryptographic random number generator.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Crypto.RNG.Class

Synopsis

Documentation

class Monad m => CryptoRNG m where Source #

Monads carrying around the RNG state.

Methods

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

Instances details
(Monad (t m), MonadTrans t, CryptoRNG m) => CryptoRNG (t m) Source #

Generic, overlapping instance.

Instance details

Defined in Crypto.RNG.Class

Methods

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 # 
Instance details

Defined in Crypto.RNG

MonadIO m => CryptoRNG (RNGT m) Source # 
Instance details

Defined in Crypto.RNG.Unsafe

Methods

randomBytes :: Int -> RNGT m ByteString Source #

random :: Uniform a => RNGT m a Source #

randomR :: UniformRange a => (a, a) -> RNGT m a Source #