-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Efficient generation of random bytestrings -- -- Efficient generation of random bytestrings. The implementation -- populates uninitialized memory with uniformily distributed random 64 -- bit words (and 8 bit words for remaining bytes at the end of the -- bytestring). -- -- Random words are generated using the PRNG from the mwc-random -- package or the pcg-random package. It is also possible to use a -- custom PRNG by providing an instance for the RandomWords type -- class and using the function generate from the module -- Data.ByteString.Random.Internal. -- -- The generated byte strings are suitable for statistical applications. -- They are not suitable for cryptographic applications. -- -- @package random-bytestring @version 0.1.2 module Data.ByteString.Random.Internal -- | Generates uniformily distributed random bytestrings of length n using -- the given PRNG. generate :: RandomWords g => g -> Natural -> IO ByteString class RandomWords g uniformW8 :: RandomWords g => g -> IO Word8 uniformW64 :: RandomWords g => g -> IO Word64 module Data.ByteString.Random.MWC -- | Generate a random bytestring of length n. The PRNG is seeded from the -- system randomness source. -- --
--   ioProperty $ ((fromIntegral n ===) . B.length) <$> random n
--   
-- --
--   n > 4 ==> ioProperty $ (/=) <$> random n <*> random n
--   
random :: Natural -> IO ByteString randomGen :: GenIO -> Natural -> IO ByteString instance g ~ System.Random.MWC.GenIO => Data.ByteString.Random.Internal.RandomWords g module Data.ByteString.Random.PCG -- | Generate a random bytestring of length n. The PRNG is seeded from the -- system randomness source. -- --
--   ioProperty $ ((fromIntegral n ===) . B.length) <$> random n
--   
-- --
--   n > 4 ==> ioProperty $ (/=) <$> random n <*> random n
--   
random :: Natural -> IO ByteString randomGen :: GenIO -> Natural -> IO ByteString instance g ~ System.Random.PCG.GenIO => Data.ByteString.Random.Internal.RandomWords g module Data.ByteString.Random