generateRandomId function

String generateRandomId()

Implementation

String generateRandomId() {
  const length = 32;
  const dictionary = 'abcdefghijklmnopqrstuvwxyz0123456789';
  final buffer = StringBuffer();

  for (var i = 0; i < length; i++) {
    buffer.write(String.fromCharCode(
      dictionary.codeUnitAt(Random().nextInt(dictionary.length)),
    ));
  }

  return buffer.toString();
}