HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecrypton-1.0.4Haskell2010

Crypto.Random.Entropy.Unsafe

  • 1 type
  • 3 values
  • Packagecrypton-1.0.4
  • Exports4
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceUnsafe.hs
valuereplenish :: Int -> [EntropyBackend] -> Ptr Word8 -> IO ()
#

Refill the entropy in a buffer

Call each entropy backend in turn until the buffer has been replenished.

If the buffer cannot be refill after 3 loopings, this will raise an User Error exception

valuegatherBackend
  1. :: EntropyBackend

    An open Entropy Backend

  2. -> Ptr Word8

    Pointer to a buffer to write to

  3. -> Int

    number of bytes to write

  4. -> IO Int

    return the number of bytes actually written

#

Gather randomness from an open handle