]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Convert mnemonic to hex entropy instead of binary
authorIan Coleman <ian@iancoleman.io>
Tue, 17 Dec 2019 22:07:17 +0000 (09:07 +1100)
committerIan Coleman <ian@iancoleman.io>
Tue, 17 Dec 2019 22:07:17 +0000 (09:07 +1100)
src/js/index.js
tests/spec/tests.js

index 3db0a31938fe8c093187c8dbace172093c42ece5..c9e7b44aa02a228cac4d5786ca5d0dad7a53f22b 100644 (file)
         }
         phraseChangeTimeoutEvent = setTimeout(function() {
             phraseChanged();
-            var entropy = mnemonic.toRawEntropyBin(DOM.phrase.val());
+            var entropy = mnemonic.toRawEntropyHex(DOM.phrase.val());
             if (entropy !== null) {
                 DOM.entropyMnemonicLength.val("raw");
                 DOM.entropy.val(entropy);
+                DOM.entropyTypeInputs.filter("[value='hexadecimal']").prop("checked", true);
+                entropyTypeAutoDetect = false;
             }
         }, 400);
     }
index bdc5909acef7cdb2350bd2501a6e07d09a6f9075..fefb8b75392ffd2149910d579b51abec907b3757 100644 (file)
@@ -4243,7 +4243,7 @@ it('Converts mnemonics into raw entropy', function(done) {
         driver.findElement(By.css('.entropy'))
             .getAttribute("value")
             .then(function(entropy) {
-                expect(entropy).toBe("00000000000000000000000000000001");
+                expect(entropy).toBe("00000001");
                 driver.findElement(By.css('.phrase'))
                     .getAttribute("value")
                     .then(function(phrase) {