random_string library

Simple library for generating random ascii strings.

More dartdocs go here.

A simple usage example:

import 'package:random_string/random_string.dart' as random; main() { print(randomBetween(10,20)); // some integer between 10 and 20 print(randomNumeric(4)); // sequence of 4 random numbers i.e. 3259 print(randomString(10)); // random sequence of 10 characters i.e. e~f93(4l- print(randomAlpha(5)); // random sequence of 5 alpha characters i.e. aRztC print(randomAlphaNumeric(10)); // random sequence of 10 alpha numeric i.e. aRztC1y32B }

Constants

ASCII_END → const int
126
ASCII_START → const int
33
LOWER_ALPHA_END → const int
122
LOWER_ALPHA_START → const int
97
NUMERIC_END → const int
57
NUMERIC_START → const int
48
UPPER_ALPHA_END → const int
90
UPPER_ALPHA_START → const int
65

Functions

randomBetween(int from, int to) int
Generates a random integer where from <= to.
randomNumeric(int length) String
Generates a random string of length with only numeric characters.
randomString(int length, {int from: ASCII_START, int to: ASCII_END}) String
Generates a random string of length with characters between ascii from to to. Defaults to characters of ascii '!' to '~'.