v1 release
This commit is contained in:
commit
cb24b68069
116 changed files with 4913 additions and 0 deletions
12
lib/shared/utils/random_string.dart
Normal file
12
lib/shared/utils/random_string.dart
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import "dart:math";
|
||||
|
||||
String randomString(int length) {
|
||||
const charset =
|
||||
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
final random = Random.secure();
|
||||
final codeUnits = List<int>.generate(
|
||||
length,
|
||||
(index) => charset.codeUnitAt(random.nextInt(charset.length)),
|
||||
);
|
||||
return String.fromCharCodes(codeUnits);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue