mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-28 05:10:41 +00:00
Entropy is truncated from the left
This provides greater compatibility with bip32jp.github.io
This commit is contained in:
+2
-1
@@ -764,7 +764,8 @@
|
||||
}
|
||||
// Discard trailing entropy
|
||||
var bitsToUse = Math.floor(bits.length / 32) * 32;
|
||||
var binaryStr = bits.substring(0, bitsToUse);
|
||||
var start = bits.length - bitsToUse;
|
||||
var binaryStr = bits.substring(start);
|
||||
// Convert entropy string to numeric array
|
||||
var entropyArr = [];
|
||||
for (var i=0; i<binaryStr.length / 8; i++) {
|
||||
|
||||
Reference in New Issue
Block a user