Created
October 5, 2014 09:53
-
-
Save devpruthvi/deba8f0cedb2dd9f105e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <pre class="brush: jscript; title: ; notranslate" title=""> | |
| var generate = function (len, chars) { | |
| var ret = '', | |
| charsLen = chars.length; | |
| while (len--) { | |
| ret += chars[Math.floor(Math.random() * charsLen)]; | |
| } | |
| return ret; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment