Skip to content

Commit

Permalink
generate passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
ansuz committed Dec 14, 2014
1 parent fa381e5 commit 45a5594
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/keys/passwd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var passwd={};
passwd.chars="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");

passwd.gen=function(L){
var result="";

for(var i=0,l=passwd.chars.length;i<L;i++){
result+=passwd.chars[Math.floor(Math.random()*l)];
}
return result;
};

module.exports=passwd;

0 comments on commit 45a5594

Please sign in to comment.