Skip to content

Instantly share code, notes, and snippets.

@damondouglas
Last active May 20, 2021 08:13
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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);
}
@laghribi98
Copy link

thank you bro

@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