fluffychat/lib/utils/get_client_secret.dart
2021-12-03 17:29:32 +01:00

10 lines
288 B
Dart

//@dart=2.12
import 'dart:math';
const _chars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890';
Random _rnd = Random();
String getClientSecret(int length) => String.fromCharCodes(Iterable.generate(
length, (_) => _chars.codeUnitAt(_rnd.nextInt(_chars.length))));