MCPcopy Index your code
hub / github.com/cnodejs/nodeclub / randomString

Function randomString

controllers/sign.js:359–369  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

357}
358
359function randomString(size) {
360 size = size || 6;
361 var code_string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
362 var max_num = code_string.length + 1;
363 var new_pass = '';
364 while (size > 0) {
365 new_pass += code_string.charAt(Math.floor(Math.random() * max_num));
366 size--;
367 }
368 return new_pass;
369}

Callers 1

sign.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected