ChaCha Deterministic Random Generator
Modulecrypton-1.0.4Haskell2010
Crypto.Random
- 4 types
- 2 classes
- 10 values
- Packagecrypton-1.0.4
- Exports16
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceChaChaDRG.hs
Deterministic instances
3 declarationsA referentially transparent System representation of the random evaluated out of the system.
Holding onto a specific DRG means that all the already evaluated bytes will be consistently replayed.
There's no need to reseed this DRG, as only pure entropy is represented here.
Instances1ByteArrayAccess
ByteArrayAccess SeedDefined in crypton-1.0.4 · Crypto.Random
Seed
4 declarationsCreate a new Seed from system entropy
Convert an integer to a Seed
Convert a Seed to an integer
Convert a binary to a seed
Deterministic Random class
7 declarationsGrab one instance of the System DRG
Create a new DRG from system entropy
Create a new DRG from a seed
Create a new DRG from 5 Word64.
This is a convenient interface to create deterministic interface for quickcheck style testing.
It can also be used in other contexts provided the input has been properly randomly generated.
Note that the Arbitrary instance provided by QuickCheck for Word64 does
not have a uniform distribution. It is often better to use instead
arbitraryBoundedRandom.
System endianness impacts how the tuple is interpreted and therefore changes the resulting DRG.
Run a pure computation with a Deterministic Random Generator in the MonadPseudoRandom
Generate len random bytes and mapped the bytes to the function f.
This is equivalent to use Control.Arrow first with randomBytesGenerate
A Deterministic Random Generator (DRG) class
Methods
randomBytesGenerate :: ByteArray byteArray => Int -> gen -> (byteArray, gen)Generate N bytes of randomness from a DRG
Random abstraction
2 declarationsA monad constraint that allows to generate random bytes
Methods
getRandomBytes :: ByteArray byteArray => Int -> m byteArray
Instances2MonadRandom
MonadRandom IODefined in crypton-1.0.4 · Crypto.Random.TypesDRG gen => MonadRandom (MonadPseudoRandom gen)Defined in crypton-1.0.4 · Crypto.Random.Types
A simple Monad class very similar to a State Monad with the state being a DRG.
Instances4Monad, Functor, Applicative, MonadRandom
DRG gen => Monad (MonadPseudoRandom gen)Defined in crypton-1.0.4 · Crypto.Random.TypesDRG gen => Functor (MonadPseudoRandom gen)Defined in crypton-1.0.4 · Crypto.Random.TypesDRG gen => Applicative (MonadPseudoRandom gen)Defined in crypton-1.0.4 · Crypto.Random.TypesDRG gen => MonadRandom (MonadPseudoRandom gen)Defined in crypton-1.0.4 · Crypto.Random.Types