23 lines
524 B
Dart
23 lines
524 B
Dart
|
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();
|
||
|
}
|
||
|
}
|