The random-strings package

[ Tags: bsd3, library, program, test, text- ] [ Propose Tags ]

Useful for generating test/benchmark data, the Test.RandomStrings module provides functions for generating random character strings in the ASCII range. You can specify probabilities for the alphabet-range chars and capital case characters.

[Skip to Readme]


Change log CHANGELOG
Dependencies base (==4.*), random (==1.*), random-strings [details]
License BSD3
Copyright (c) 2016 Michael Hatfield
Author Michael Hatfield
Category Text , Test
Home page
Bug tracker
Source repo head: git clone git:// -b master
this: git clone git:// -b master(tag
Uploaded Tue Jul 26 07:13:44 UTC 2016 by mikehat
Distributions NixOS:
Executables readme-example
Downloads 449 total (16 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for random-strings-

[back to package description]


A simple way to generate random strings for testing and benchmarking.

A purely random character string is not always the best test case for testing and benchmarking. These modules help generate random strings with preferences for character sets and character properties.


module Main ( main ) where

import Test.RandomStrings

iso_alpha = onlyAlpha randomChar8
ascii_alphanum = onlyAlphaNum randomASCII

-- print a list of 30 random alphanumeric strings between 5 and 25
-- chars long.

main = do
    words <- randomStringsLen (randomString ascii_alphanum) (5,25) 30
    mapM_ putStrLn words

Build the example with cabal build readme-example.

Functions allow tuning strings for character class and toying with the distribution of alphabetic and upper/lower-case characters.