mirror of
https://github.com/S2-/pwgen.git
synced 2025-08-02 17:00:03 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
c26eba33c0 | |||
42838040d2 | |||
8ab06aa554 |
@@ -2,7 +2,7 @@
|
||||
"description": "Just a toolbar button that generates a password and copies it to your clipboard.",
|
||||
"manifest_version": 2,
|
||||
"name": "pwgen reloaded",
|
||||
"version": "1.1.5",
|
||||
"version": "1.1.6",
|
||||
"homepage_url": "https://github.com/S2-/pwgen",
|
||||
"icons": {
|
||||
"48": "icons/lock-48.png"
|
||||
|
@@ -4,8 +4,6 @@
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="chrome://global/skin/global.css" type="text/css" />
|
||||
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" type="text/css" />
|
||||
<link rel="stylesheet" href="chrome://mozapps/content/extensions/extensions.css" type="text/css" />
|
||||
<link rel="stylesheet" href="resource://gre-resources/forms.css" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" href="pwgen.css"/>
|
||||
</head>
|
||||
|
@@ -3,10 +3,15 @@ function randPassword(length, includeSpecial) {
|
||||
if (includeSpecial) {
|
||||
pwdChars += '°^!"§$%&/()=?`´\\}][{²³€|<>-.,;:*+_µ@~';
|
||||
}
|
||||
let randPassword = Array(length).fill(pwdChars).map(function(x) {
|
||||
return x[Math.floor(Math.random() * x.length)]
|
||||
}).join('');
|
||||
return randPassword;
|
||||
|
||||
let randValues = new Uint32Array(length);
|
||||
let randPwd = '';
|
||||
window.crypto.getRandomValues(randValues);
|
||||
for(i=0; i<length; i++)
|
||||
{
|
||||
randPwd += pwdChars[randValues[i] % pwdChars.length];
|
||||
}
|
||||
return randPwd;
|
||||
}
|
||||
|
||||
function getParams() {
|
||||
|
Reference in New Issue
Block a user