mirror of
https://github.com/esiur/esiur-dart.git
synced 2026-04-03 17:58:21 +00:00
1.3
This commit is contained in:
13
lib/src/Misc/Global.dart
Normal file
13
lib/src/Misc/Global.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'dart:math';
|
||||
|
||||
class Global {
|
||||
static String generateCode(
|
||||
[int length = 16,
|
||||
chars =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"]) {
|
||||
var rand = Random();
|
||||
|
||||
return String.fromCharCodes(Iterable.generate(
|
||||
length, (_) => chars.codeUnitAt(rand.nextInt(chars.length))));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user