dvStudioNewKey function

String dvStudioNewKey()

A new record key: twenty characters of secure random, lower case and digits, so it reads in an address and sorts nowhere in particular.

Implementation

String dvStudioNewKey() {
  final math.Random random = math.Random.secure();
  const String alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789';
  return String.fromCharCodes(<int>[
    for (int i = 0; i < 20; i++)
      alphabet.codeUnitAt(random.nextInt(alphabet.length)),
  ]);
}