1 | module.exports.randomId = function randomId(noOfTexts) {
|
2 | noOfTexts = noOfTexts || 17;
|
3 |
|
4 | var text = "";
|
5 | var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
6 |
|
7 | for( var i=0; i < noOfTexts; i++ ) {
|
8 | text += possible.charAt(Math.floor(Math.random() * possible.length));
|
9 | }
|
10 | return text;
|
11 | }; |
\ | No newline at end of file |