diff --git a/chrome/chromeFiles/content/scholar/xpcom/scholar.js b/chrome/chromeFiles/content/scholar/xpcom/scholar.js index 44e125275..eadd95afc 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/scholar.js +++ b/chrome/chromeFiles/content/scholar/xpcom/scholar.js @@ -21,6 +21,7 @@ var Scholar = new function(){ this.getString = getString; this.flattenArguments = flattenArguments; this.join = join; + this.randomString = randomString; this.Hash = Hash; @@ -177,6 +178,23 @@ var Scholar = new function(){ } + /** + * Generate a random string of length 'len' (defaults to 8) + **/ + function randomString(len) { + var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; + if (!len){ + len = 8; + } + var randomstring = ''; + for (var i=0; i