random-bytestring-0.1.3: Efficient generation of random bytestrings

Copyright(c) Lars Kuhtz <lakuhtz@gmail.com> 2017
LicenseMIT
Maintainerlakuhtz@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.ByteString.Random.MWC

Contents

Description

 

Synopsis

Documentation

random Source #

Arguments

:: Natural

Length of the result bytestring in bytes

-> IO ByteString 

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

randomGen Source #

Arguments

:: GenIO

PRNG

-> Natural

Length of the result bytestring in bytes

-> IO ByteString 

Orphan instances

(~) * g GenIO => RandomWords g Source #