Skip to content

Instantly share code, notes, and snippets.

@cjthompson
Created June 16, 2015 18:35
Show Gist options
  • 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