summaryrefslogtreecommitdiff
path: root/src/crypto/reflibs/Crypto/Random.hs
blob: 62971550a0522314a7c2087fc71aac8ce5514354 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Crypto.Random (
    MonadRandom(..),
) where

import Crypto.Random.Entropy

import Data.ByteArray

class Monad m => MonadRandom m where
    getRandomBytes :: ByteArray byteArray => Int -> m byteArray

instance MonadRandom IO where
    getRandomBytes = fmap convert . getEntropy