random static method

String random([
  1. int length = 16
])

Generates a cryptographically random alphanumeric string of length.

Implementation

static String random([int length = 16]) {
  final buffer = StringBuffer();
  for (var i = 0; i < length; i++) {
    buffer.write(_alphaNum[_random.nextInt(_alphaNum.length)]);
  }
  return buffer.toString();
}