Skip to content

Instantly share code, notes, and snippets.

@cjthompson
Created June 16, 2015 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjthompson/7e584a0a2d0cdcad1de0 to your computer and use it in GitHub Desktop.
Save cjthompson/7e584a0a2d0cdcad1de0 to your computer and use it in GitHub Desktop.
JavaScript: random string
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