Skip to content

Instantly share code, notes, and snippets.

@lusentis
Created February 10, 2014 11:55
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 lusentis/8914560 to your computer and use it in GitHub Desktop.
Save lusentis/8914560 to your computer and use it in GitHub Desktop.
Make a random password
'use strict';
var PASS_LENGTH = [1, 4, 2];
var _makePassword = module.exports.makePassword = function () {
var a = [
'ABCDEFGHJKMNPQRSTUVXZ',
'abcdefghjkmnpqrstuvxz',
'23564789'
].map(function (i) { return i.split(''); });
var p = [];
PASS_LENGTH.forEach(function (count, index) {
p.push(a[index].sample(count).join(''));
});
return p.join('');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment