1 module Databrary.Service.Entropy 2 ( Entropy 3 , initEntropy 4 , entropyBytes 5 ) where 6 7 import Data.ByteArray (ByteArray) 8 import Crypto.Random.EntropyPool 9 10 type Entropy = EntropyPool 11 12 initEntropy :: IO Entropy 13 initEntropy = createEntropyPool 14 15 entropyBytes :: ByteArray a => Int -> Entropy -> IO a 16 entropyBytes = flip getEntropyFrom