random_string library

Simple library for generating random ascii strings.

Classes

AbstractRandomProvider
A generator of double values.
CoreRandomProvider
A generator of random values using a supplied math.Random.
DefaultRandomProvider
A generator of pseudo-random double values using the default math.Random.

Constants

asciiEnd → const int
asciiStart → const int
lowerAlphaEnd → const int
lowerAlphaStart → const int
maxSupportedInteger → const int
minSupportedInteger → const int
numericEnd → const int
numericStart → const int
upperAlphaEnd → const int
upperAlphaStart → const int

Functions

randomAlpha(int length, {AbstractRandomProvider provider = const DefaultRandomProvider()}) String
Generates a random string of length with only alpha characters.
randomAlphaNumeric(int length, {AbstractRandomProvider provider = const DefaultRandomProvider()}) String
Generates a random string of length with alpha-numeric characters.
randomBetween(int from, int to, {AbstractRandomProvider provider = const DefaultRandomProvider()}) int
Generates a random integer where from <= to inclusive where 0 <= from <= to <= 999999999999999
randomMerge(String a, String b) String
Merge a with b and shuffle.
randomNumeric(int length, {AbstractRandomProvider provider = const DefaultRandomProvider()}) String
Generates a random string of length with only numeric characters.
randomString(int length, {int from = asciiStart, int to = asciiEnd, AbstractRandomProvider provider = const DefaultRandomProvider()}) String
Generates a random string of length with characters between ascii from to to. Defaults to characters of ascii '!' to '~'.

Exceptions / Errors

ProviderError
ProviderError thrown when a Provider provides a value outside the expected [0, 1) range.