mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-05 18:43:47 +00:00
Convert mnemonic to hex entropy instead of binary
This commit is contained in:
@@ -239,10 +239,12 @@
|
|||||||
}
|
}
|
||||||
phraseChangeTimeoutEvent = setTimeout(function() {
|
phraseChangeTimeoutEvent = setTimeout(function() {
|
||||||
phraseChanged();
|
phraseChanged();
|
||||||
var entropy = mnemonic.toRawEntropyBin(DOM.phrase.val());
|
var entropy = mnemonic.toRawEntropyHex(DOM.phrase.val());
|
||||||
if (entropy !== null) {
|
if (entropy !== null) {
|
||||||
DOM.entropyMnemonicLength.val("raw");
|
DOM.entropyMnemonicLength.val("raw");
|
||||||
DOM.entropy.val(entropy);
|
DOM.entropy.val(entropy);
|
||||||
|
DOM.entropyTypeInputs.filter("[value='hexadecimal']").prop("checked", true);
|
||||||
|
entropyTypeAutoDetect = false;
|
||||||
}
|
}
|
||||||
}, 400);
|
}, 400);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4243,7 +4243,7 @@ it('Converts mnemonics into raw entropy', function(done) {
|
|||||||
driver.findElement(By.css('.entropy'))
|
driver.findElement(By.css('.entropy'))
|
||||||
.getAttribute("value")
|
.getAttribute("value")
|
||||||
.then(function(entropy) {
|
.then(function(entropy) {
|
||||||
expect(entropy).toBe("00000000000000000000000000000001");
|
expect(entropy).toBe("00000001");
|
||||||
driver.findElement(By.css('.phrase'))
|
driver.findElement(By.css('.phrase'))
|
||||||
.getAttribute("value")
|
.getAttribute("value")
|
||||||
.then(function(phrase) {
|
.then(function(phrase) {
|
||||||
|
|||||||
Reference in New Issue
Block a user