Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Synopsis
- class (Monad m, Applicative m) => MonadRandomBytes m where
- randomBytes :: Int -> m ByteString
- newKeyPair :: m KeyPair
- randomBinary :: MonadRandomBytes m => Get a -> Int -> m a
- randomKey :: forall m a. (MonadRandomBytes m, CryptoNumber a) => m (Key a)
- randomNonce :: MonadRandomBytes m => m Nonce
- randomWord64 :: MonadRandomBytes m => m Word64
- randomWord32 :: MonadRandomBytes m => m Word32
- randomWord16 :: MonadRandomBytes m => m Word16
- randomWord8 :: MonadRandomBytes m => m Word8
- randomInt :: MonadRandomBytes m => Int -> m Int
- randomIntR :: MonadRandomBytes m => (Int, Int) -> m Int
- uniform :: MonadRandomBytes m => [a] -> m a
- uniformSafe :: MonadRandomBytes m => [a] -> m (Maybe a)
Documentation
class (Monad m, Applicative m) => MonadRandomBytes m where Source #
randomBytes :: Int -> m ByteString Source #
newKeyPair :: m KeyPair Source #
Instances
randomBinary :: MonadRandomBytes m => Get a -> Int -> m a Source #
randomKey :: forall m a. (MonadRandomBytes m, CryptoNumber a) => m (Key a) Source #
randomNonce :: MonadRandomBytes m => m Nonce Source #
randomWord64 :: MonadRandomBytes m => m Word64 Source #
randomWord32 :: MonadRandomBytes m => m Word32 Source #
randomWord16 :: MonadRandomBytes m => m Word16 Source #
randomWord8 :: MonadRandomBytes m => m Word8 Source #
randomIntR :: MonadRandomBytes m => (Int, Int) -> m Int Source #
uniform :: MonadRandomBytes m => [a] -> m a Source #
produces uniformly random element of a list
uniformSafe :: MonadRandomBytes m => [a] -> m (Maybe a) Source #