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
126
asciiStart → const int
33
lowerAlphaEnd → const int
122
lowerAlphaStart → const int
97
maxSupportedInteger → const int
999999999999999
minSupportedInteger → const int
0
numericEnd → const int
57
numericStart → const int
48
upperAlphaEnd → const int
90
upperAlphaStart → const int
65

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.