getRandString function

String getRandString(
  1. int len
)

Generates a random string to be used as the VisibilityDetector key. Technically this limits the number of editors to a finite number, but nobody will be embedding enough editors to reach the theoretical limit (yes, this is a challenge ;-) )

Implementation

String getRandString(int len) {
  var random = Random.secure();
  var values = List<int>.generate(len, (i) => random.nextInt(255));
  return base64UrlEncode(values);
}