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

6 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
s2
07b558eeb7 v1.1.5 2017-11-21 09:13:36 +01:00
s2
be3046051a do not repeat numbers 2017-11-21 09:11:22 +01:00
s2
17c92ce99a update screenshot 2017-11-21 08:33:42 +01:00
4 changed files with 11 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 68 KiB

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.4",
"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

@@ -1,12 +1,17 @@
function randPassword(length, includeSpecial) {
let pwdChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
let pwdChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
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() {