aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/js/index.js5
-rw-r--r--tests.js17
2 files changed, 20 insertions, 2 deletions
diff --git a/src/js/index.js b/src/js/index.js
index f354399..6a81601 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -869,10 +869,11 @@
869 var dupeTracker = {}; 869 var dupeTracker = {};
870 for (var i=0; i<entropy.base.parts.length; i++) { 870 for (var i=0; i<entropy.base.parts.length; i++) {
871 var card = entropy.base.parts[i]; 871 var card = entropy.base.parts[i];
872 if (card in dupeTracker) { 872 var cardUpper = card.toUpperCase();
873 if (cardUpper in dupeTracker) {
873 dupes.push(card); 874 dupes.push(card);
874 } 875 }
875 dupeTracker[card] = true; 876 dupeTracker[cardUpper] = true;
876 } 877 }
877 if (dupes.length > 0) { 878 if (dupes.length > 0) {
878 var dupeWord = "duplicates"; 879 var dupeWord = "duplicates";
diff --git a/tests.js b/tests.js
index c3d7418..a0de5fe 100644
--- a/tests.js
+++ b/tests.js
@@ -2673,6 +2673,23 @@ page.open(url, function(status) {
2673 words: 54, 2673 words: 54,
2674 strength: "extremely strong", 2674 strength: "extremely strong",
2675 }, 2675 },
2676 // Case insensitivity to duplicate cards
2677 {
2678 entropy: "asAS",
2679 type: "card (1 duplicate: AS)",
2680 events: 2,
2681 bits: 12,
2682 words: 0,
2683 strength: "extremely weak",
2684 },
2685 {
2686 entropy: "ASas",
2687 type: "card (1 duplicate: as)",
2688 events: 2,
2689 bits: 12,
2690 words: 0,
2691 strength: "extremely weak",
2692 },
2676 ]; 2693 ];
2677 // use entropy 2694 // use entropy
2678 page.evaluate(function() { 2695 page.evaluate(function() {