@hackage dice-entropy-conduit1.0.0.3
Cryptographically secure n-sided dice via rejection sampling
Categories
License
LGPL-2.1-only
Maintainer
pwr@lowerbound.io
Links
Versions
Installation
Dependencies (5)
- base >=4.6 && <5
- bytestring >=0.9
- conduit >=1.1.7
- entropy >=0.3.2
- transformers >=0.4.0.0 Show all…
Dependents (3)
@hackage/acme-everything, @hackage/keysafe, @hackage/secret-sharing
This library uses rejection sampling to provide cryptographically secure n-sided dice rolls and random sampling (within a given range).
Usage:
If we want to use the system-specific entropy source (systemEntropy) to
produce 10 dice rolls of a 6-sided dice (i.e. range [0,5]), you can write:
systemEntropy $$ diceRolls 6 =$= CL.take 10 [5,1,3,3,0,5,3,2,2,1]