2
0
mirror of https://github.com/esiur/esiur-dart.git synced 2026-04-02 01:38:20 +00:00
Files
esiur-dart/lib/src/Misc/Global.dart
2022-03-12 16:21:29 +03:00

14 lines
344 B
Dart

import 'dart:math';
class Global {
static String generateCode(
[int length = 16,
String chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"]) {
var rand = Random();
return String.fromCharCodes(Iterable.generate(
length, (_) => chars.codeUnitAt(rand.nextInt(chars.length))));
}
}