From 0298c19e13f91bc00c681927f84ecd2ee7535cb7 Mon Sep 17 00:00:00 2001 From: byron jones Date: Thu, 2 Mar 2017 11:55:37 +0800 Subject: [PATCH] Fix password generation's handling of the ambiguous option. (#100) * Fix password generation's handling of the ambiguous option. Fixes #97 * Invert options.ambiguous's value in the UI. options.ambiguous means "allow ambiguous characters", however the checkbox is labeled "avoid ambiguous characters". inverse the value at display time to reflect to reflect reality. --- src/popup/app/tools/views/toolsPasswordGenerator.html | 4 +++- src/services/passwordGenerationService.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/popup/app/tools/views/toolsPasswordGenerator.html b/src/popup/app/tools/views/toolsPasswordGenerator.html index b291a088f1e..dcc80599f6b 100644 --- a/src/popup/app/tools/views/toolsPasswordGenerator.html +++ b/src/popup/app/tools/views/toolsPasswordGenerator.html @@ -70,7 +70,9 @@
- +
diff --git a/src/services/passwordGenerationService.js b/src/services/passwordGenerationService.js index 48ea61b09ce..3e3d50d9228 100644 --- a/src/services/passwordGenerationService.js +++ b/src/services/passwordGenerationService.js @@ -103,7 +103,7 @@ function initPasswordGenerationService() { // ref https://github.com/EFForg/OpenWireless/blob/master/app/js/diceware.js function randomInt(min, max) { var rval = 0; - var range = max - min; + var range = max - min + 1; var bits_needed = Math.ceil(Math.log2(range)); if (bits_needed > 53) {