Created
June 16, 2015 18:35
-
-
Save cjthompson/7e584a0a2d0cdcad1de0 to your computer and use it in GitHub Desktop.
JavaScript: random string
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
var _ = require('lodash'); | |
var randomString = function (length) { | |
return _(length).range().map(_.partial(_.random, 33, 126, false)).map(_.ary(String.fromCharCode)).join(''); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment