randomString function

String randomString(
  1. int length, {
  2. bool? lower,
  3. bool? upper,
  4. bool? numeric,
  5. bool? controls,
  6. bool? punctuations,
  7. List<int>? whitelist,
  8. List<int>? blacklist,
  9. RNG generator = RNG.secure,
})

Generate a list of random ASCII string of size length.

Check the HashlibRandom.nextString documentation for more details.

Implementation

@pragma('vm:prefer-inline')
String randomString(
  int length, {
  bool? lower,
  bool? upper,
  bool? numeric,
  bool? controls,
  bool? punctuations,
  List<int>? whitelist,
  List<int>? blacklist,
  RNG generator = RNG.secure,
}) =>
    HashlibRandom(generator).nextString(
      length,
      lower: lower,
      upper: upper,
      numeric: numeric,
      controls: controls,
      punctuations: punctuations,
      whitelist: whitelist,
      blacklist: blacklist,
    );