packages feed

dice-entropy-conduit 1.0.0.0 → 1.0.0.1

raw patch · 2 files changed

+26/−12 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

dice-entropy-conduit.cabal view
@@ -1,5 +1,5 @@ name:           dice-entropy-conduit-version:        1.0.0.0+version:        1.0.0.1 cabal-version:  >=1.8 build-type:     Simple license:        LGPL-2.1@@ -13,15 +13,29 @@ category:       Cryptography, Data  synopsis:       Cryptographically secure n-sided dice via rejection sampling.  description:    -  This library uses rejection sampling to provide cryptographically secure -  @n@-sided dice rolls and random sampling (within a given range). -  The number of used random bits is close to the information-theoretic optimal-  bound.-  .-  The API provides a conduit interface.-  See module "System.Random.Dice" for a more detailed description.-  .-  Feedback is welcome!+   This library uses rejection sampling to provide cryptographically secure +   @n@-sided dice rolls and random sampling (within a given range). +   The number of used random bits is close to the information-theoretic optimal+   bound.+   .+   /Usage:/+   .+   If we wanted to use the system-specific entropy source ('systemEntropy') to+   produce 10 dice rolls of a 6-sided dice (i.e. range [0,5]), we could write:+   .+   > > systemEntropy $$ diceRolls 6 =$= CL.take 10 +   > [5,1,3,3,0,5,3,2,2,1]+   .+   The function 'testPerformance' yields the actual number of consumed random+   bits:+   .+   > > testPerformance 12 10000+   > Generated 10000 random samples in range [0,11]+   > Average number of bits used: 3.5904+   > Entropy lower bound on the number of required bits: 3.5849625007211565+   > Performance ratio: 1.0015167520658164+   .+   Feedback is welcome!  library   hs-source-dirs:  src
src/System/Random/Dice/Internal.hs view
@@ -90,8 +90,8 @@ -- | A source of entropy. By default, we use the 'getEntropy' function from -- the entropy package, see 'systemEntropy'.  ----- /Warning:/ When combining a source of entropy with another conduits, it is--- important to ensure that there is no \"backflow\" due to leftover values that +-- /Warning:/ When combining a source of entropy with other conduits, it is+-- important that there is no \"backflow\" due to leftover values that  -- are being returned to the -- source from the conduit. This can be done by fusing the conduit with the -- identity map, e.g: @myEntropySrc $$ Data.Conduit.List.map id =$= myConduit@