Skip to content

Instantly share code, notes, and snippets.

@damondouglas
Last active May 20, 2021 08:13
Show Gist options
  • Save damondouglas/30191a38f5c3daa482fc to your computer and use it in GitHub Desktop.
Save damondouglas/30191a38f5c3daa482fc to your computer and use it in GitHub Desktop.
Generate Random String based on length
import 'dart:math';
String _randomString(int length) {
var rand = new Random();
var codeUnits = new List.generate(
length,
(index){
return rand.nextInt(33)+89;
}
);
return new String.fromCharCodes(codeUnits);
}
@encore-by-dev
Copy link

Thank you!

@krispykalsi
Copy link

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment