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.Number.Generate

  • 1 type
  • 4 values
  • Packagecrypton-1.0.4
  • Exports5
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceGenerate.hs
valuegenerateParams
  1. :: MonadRandom m
  2. => Int

    number of bits

  3. -> Maybe GenTopPolicy

    top bit policy

  4. -> Bool

    force the number to be odd

  5. -> m Integer
#

Generate a number for a specific size of bits, and optionaly set bottom and top bits

If the top bit policy is Nothing, then nothing is done on the highest bit (it's whatever the random generator set).

If @generateOdd is set to True, then the number generated is guaranteed to be odd. Otherwise it will be whatever is generated