random_string
Simple library for generating random ascii strings.
Design goals and limitations
While this package provides randomBetween for convenience, as the name implies, the design goal of this package
is for random generation of ascii strings, particularly for testing and not for cryptographic purposes.
With that stated, consider an alternative means of random number generation if your needs fall outside these goals
and limitations.
Usage
A simple usage example:
import 'package:random_string/random_string.dart';
import 'dart:math' show Random;
main() {
print(randomBetween(10, 20));
print(randomNumeric(4));
print(randomString(10));
print(randomAlpha(5));
print(randomAlphaNumeric(10));
var r = Random.secure();
print(randomBetween(10, 20, provider: CoreRandomProvider.from(r)));
print(randomBetween(10, 20, provider: _Provider()));
}
class _Provider with AbstractRandomProvider {
_Provider();
double nextDouble() => 0.5;
}
Features and bugs
Please file feature requests and bugs at the issue tracker.