Skip to content

Commit

Permalink
Some cleanup and renaming some j's to i's
Browse files Browse the repository at this point in the history
  • Loading branch information
heavensrevenge committed Sep 21, 2014
1 parent b971381 commit 9f2116e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
4 changes: 2 additions & 2 deletions javascript/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ function dumpedProfiles() {

// patterns
if (prof.siteList) {
var pats = prof.siteList.trim().split(" ");
var pats = prof.siteList.trim().split(/\s+/);
for (var k = 0; k < pats.length; k++) {
var pat = pats[k],
ptype = (pat[0] == "/" && pat[pat.length - 1] == "/") ? "regex" : "wildcard";
ptype = (pat[0] === "/" && pat[pat.length - 1] === "/") ? "regex" : "wildcard";

newProf["pattern" + k] = (ptype === "regex") ? pat.substring(1, pat.length - 1) : pat;
newProf["patternenabled" + k] = "true";
Expand Down
23 changes: 12 additions & 11 deletions javascript/passwordmaker/hashutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ if (typeof PasswordMaker_HashUtils !== "object") {
*/
rstr2binl: function(input) {
var output = [];
for (var j = 0; j < input.length * 8; j += 8) {
output[j >> 5] |= (input.charCodeAt(j / 8) & 0xFF) << (j % 32);
for (var i = 0; i < input.length * 8; i += 8) {
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);
}
return output;
},
Expand All @@ -35,7 +35,7 @@ if (typeof PasswordMaker_HashUtils !== "object") {
binl2rstr: function(input) {
var output = "";
for (var i = 0; i < input.length * 32; i += 8) {
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);
output += String.fromCharCode((input[i >> 5] >> (i % 32)) & 0xFF);
}
return output;
},
Expand All @@ -44,18 +44,19 @@ if (typeof PasswordMaker_HashUtils !== "object") {
* Convert a raw string to an arbitrary string encoding
*/
rstr2any: function(input, encoding) {
var divisor = encoding.length;
var remainders = [];
var divisor = encoding.length,
remainders = [],
i = 0;
/* Convert to an array of 16-bit big-endian values, forming the dividend */
var dividend = [];
for (var i = 0; i < (input.length / 2); i++) {
for (i = 0; i < (input.length / 2); i++) {
dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
}
while (dividend.length > 0) {
var quotient = [];
var x = 0;
for (var j = 0; j < dividend.length; j++) {
x = (x << 16) + dividend[j];
for (i = 0; i < dividend.length; i++) {
x = (x << 16) + dividend[i];
var q = Math.floor(x / divisor);
x -= q * divisor;
if (quotient.length > 0 || q > 0) {
Expand All @@ -79,8 +80,8 @@ if (typeof PasswordMaker_HashUtils !== "object") {
*/
rstr2binb: function(input) {
var output = [];
for (var j = 0; j < input.length * 8; j += 8) {
output[j >> 5] |= (input.charCodeAt(j / 8) & 0xFF) << (24 - j % 32);
for (var i = 0; i < input.length * 8; i += 8) {
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32);
}
return output;
},
Expand All @@ -91,7 +92,7 @@ if (typeof PasswordMaker_HashUtils !== "object") {
binb2rstr: function(input) {
var output = "";
for (var i = 0; i < input.length * 32; i += 8) {
output += String.fromCharCode((input[i >> 5] >>> (24 - i % 32)) & 0xFF);
output += String.fromCharCode((input[i >> 5] >> (24 - i % 32)) & 0xFF);
}
return output;
},
Expand Down
11 changes: 4 additions & 7 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"short_name": "PasswordMaker Pro",
"version": "0.7.7",
"manifest_version": 2,
"description": "Flexible password generator using a cryptographic hash algorithm of your choice - Compatible with PasswordMaker.org",
"description": "Flexible password generator using a cryptographic hash algorithm of your choice - Fully Compatible with PasswordMaker.org",
"homepage_url": "https://github.com/passwordmaker/chrome-passwordmaker",
"icons": {
"icons": {
"16": "images/passwdmaker16.png",
"48": "images/passwdmaker48.png",
"128": "images/passwdmaker128.png"
Expand All @@ -14,12 +14,9 @@
"default_icon": "images/passwdmaker48.png",
"default_popup": "html/popup.html"
},
"permissions": [
"activeTab",
"storage"
],
"permissions": ["activeTab", "storage"],
"background": {
"scripts": [ "javascript/background.js" ]
"scripts": ["javascript/background.js"]
},
"options_page": "html/options.html",
"commands": {
Expand Down

0 comments on commit 9f2116e

Please sign in to comment.