Skip to content

Instantly share code, notes, and snippets.

@skyjur
Created January 22, 2019 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skyjur/ff53f7798e7d3ba32a49bdf728be9ae3 to your computer and use it in GitHub Desktop.
Save skyjur/ff53f7798e7d3ba32a49bdf728be9ae3 to your computer and use it in GitHub Desktop.
dart:randomString
import 'dart:math';
String randomString(int length) {
final rand = Random.secure();
final codeUnits = List.generate(length, (index) {
return rand.nextInt(33) + 89;
});
return String.fromCharCodes(codeUnits);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment