selfprivacy.org.app/lib/utils/password_generator2.dart
2021-02-17 15:30:02 +01:00

15 lines
333 B
Dart

import 'dart:math';
const _chars =
'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890_';
Random _rnd = Random();
String getRandomString(int length) => String.fromCharCodes(
Iterable.generate(
length,
(_) => _chars.codeUnitAt(
_rnd.nextInt(_chars.length),
),
),
);