librandomorg-0.0.1.0: Wrapper to Random.org API

Safe HaskellSafe-Infered

Network.Randomorg

Description

Random.org API module

Synopsis

Documentation

data RNG Source

Specify the randomization method

Constructors

New

Truly random bitstream

Id String

Determine randomization from a large pool of pregenerated bits

Date String

Determine randomization based on one of the daily pregenerated files. The date must be in YYYY-MM-DD format or one of the two shorthand strings today or yesterday.

Instances

Get RNG 

integersSource

Arguments

:: Int

Number of integers to generate ([1,1e4])

-> Int

Minimum value (-1e9,1e9)

-> Int

Maximum value (-1e9,1e9)

-> RNG 
-> IO (Maybe [Int]) 

Generate random integers in configurable intervals

shuffleSource

Arguments

:: Int

Minimum value (-1e9,1e9)

-> Int

Maximum value (-1e9,1e9)

-> RNG 
-> IO (Maybe [Int]) 

Shuffle integers in given interval

NOTE: Maintains the invariant `max - min + 1 <= 1e4'

NOTE: Doesn't maintain the invariant `max >= min'

stringsSource

Arguments

:: Int

Number of strings to generate ([1,1e4])

-> Int

Length of each string ([1,20])

-> Bool

Allow digits

-> Bool

Allow uppercase alphabetic characters

-> Bool

Allow lowercase alphabetic characters

-> Bool

Whether all string should be unique

-> RNG 
-> IO [String] 

Generate random strings of various length and composition

quotaSource

Arguments

:: Maybe (Word8, Word8, Word8, Word8)

Optional IP address. If not provided use IP of the caller

-> IO (Maybe Integer) 

Examine quota for given IP address