aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2016-11-17 11:34:09 +1100
committerIan Coleman <coleman.ian@gmail.com>2016-11-17 11:34:09 +1100
commit5c653a12e7f76ce026c8953cba6753200dc3c6c3 (patch)
treec4b2066c2c5bc772fd7d9d03a58480daca079b38 /src
parent95f04905c13775e00c8dc13f884a17a4e69aaf29 (diff)
downloadBIP39-5c653a12e7f76ce026c8953cba6753200dc3c6c3.tar.gz
BIP39-5c653a12e7f76ce026c8953cba6753200dc3c6c3.tar.zst
BIP39-5c653a12e7f76ce026c8953cba6753200dc3c6c3.zip
Duplicate card detection is case insensitive
Diffstat (limited to 'src')
-rw-r--r--src/js/index.js5
1 files changed, 3 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";