fromCharset static method
Generates a random string from a custom charset.
Implementation
static String fromCharset(int length, String charset) {
if (charset.isEmpty) {
throw ArgumentError('charset cannot be empty');
}
final rand = math.Random();
return List.generate(length, (_) => charset[rand.nextInt(charset.length)]).join('');
}