ocarina2/lib/util/util.dart

23 lines
524 B
Dart
Raw Normal View History

2024-05-23 19:14:08 +02:00
import 'dart:math';
import 'package:logger/web.dart';
String _letters =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-";
final logger = Logger();
/// Class for all utility functions
class Util {
/// Creates a 14 characters-long string comprised of random characters
/// from _letter
static String get makeSalt {
final d = StringBuffer();
final r = Random();
for (var i = 0; i < 14; i++) {
d.write(_letters[r.nextInt(_letters.length)]);
}
return d.toString();
}
}