1
0
mirror of https://github.com/S2-/pwgen.git synced 2025-08-02 17:00:03 +02:00

3 Commits

Author SHA1 Message Date
s2
c26eba33c0 v1.1.6 2017-11-21 09:31:21 +01:00
s2
42838040d2 use crypto.getRandomValues 2017-11-21 09:30:54 +01:00
s2
8ab06aa554 remove useless css 2017-11-21 09:30:44 +01:00
3 changed files with 10 additions and 7 deletions

View File

@@ -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"

View File

@@ -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>

View File

@@ -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() {