Created
April 20, 2018 16:22
-
-
Save avisser/d5577692b7511dad24599ac9395dd249 to your computer and use it in GitHub Desktop.
js.resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define(factory); | |
} else if (typeof exports === 'object') { | |
module.exports = factory(); | |
} else { | |
root.ActionUtils = factory(); | |
} | |
}(this, function() { | |
'use strict'; | |
return { | |
generateId : function (len) { | |
var text = ""; | |
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; | |
for( var i=0; i < len; i++ ) { | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
} | |
return text; | |
} | |
} | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment