From 5f7d2e58809ef16278f47448f1866588ba352da1 Mon Sep 17 00:00:00 2001 From: Tim Robinson Date: Wed, 3 Feb 2016 21:32:18 +0000 Subject: [PATCH] Add randomchars lib --- node_modules/c9/randomchars.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 node_modules/c9/randomchars.js diff --git a/node_modules/c9/randomchars.js b/node_modules/c9/randomchars.js new file mode 100644 index 00000000..0aedac95 --- /dev/null +++ b/node_modules/c9/randomchars.js @@ -0,0 +1,14 @@ +function getRandomChars(len) { + var text = ""; + if (!len) len = 5; + var possible = "abcdefghijklmnopqrstuvwxyz0123456789"; + + for (var i=0; i < len; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + + return text; +} + +module.exports = getRandomChars; +