Entropy is truncated from the left

This provides greater compatibility with bip32jp.github.io
This commit is contained in:
Ian Coleman
2016-11-14 13:21:04 +11:00
parent dd94490656
commit d6fd8ebf86
2 changed files with 5 additions and 6 deletions
+2 -1
View File
@@ -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++) {