mirror of
https://github.com/esiur/esiur-dart.git
synced 2026-04-02 01:38:20 +00:00
14 lines
344 B
Dart
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))));
|
|
}
|
|
}
|