Skip to content

Commit

Permalink
Changes for clarity
Browse files Browse the repository at this point in the history
Even though line 199 is proper syntax, I think it's harder to read than declaring each variable where it first appears.
  • Loading branch information
alanhkarp committed Jul 3, 2024
1 parent bf6759f commit 0364df1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/bg.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,17 @@ let SitePassword = ((function (self) {
}
}
function shuffle(chars) {
let currentIndex = chars.length, temporaryValue, randomIndex;
let currentIndex = chars.length;
let charsArray = chars.split("");
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = byteArray[currentIndex] % charsArray.length;
let index = byteArray[currentIndex] % charsArray.length;
currentIndex -= 1;
// And swap it with the current element.
temporaryValue = charsArray[currentIndex];
charsArray[currentIndex] = charsArray[randomIndex];
charsArray[randomIndex] = temporaryValue;
let temporaryValue = charsArray[currentIndex];
charsArray[currentIndex] = charsArray[index];
charsArray[index] = temporaryValue;
}
chars = charsArray.join("");
return chars;
Expand Down Expand Up @@ -459,7 +459,7 @@ function Utf8Encode(string) {
self.domainname = "";
return self.loadSettings(); // reset to default settings
}
return self;
return self;
})({
version: "3.0",
clearsuperpw: false,
Expand All @@ -468,7 +468,6 @@ function Utf8Encode(string) {
upper: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
specials: "$/!=@?._-",
}));

/*
This code is a major modification of the code released with the
following licence. Neither Hewlett-Packard Company nor Hewlett-Packard
Expand Down

0 comments on commit 0364df1

Please sign in to comment.