X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=bip39-standalone.html;h=0da24437181736c881cac998976602e85ebb11cf;hb=fc7c248fafef4ba2aecf9dcf4718b3d4c91d94b0;hp=4bad422a672a0999a644d43b0fed096dbe49fd26;hpb=94959756408aa60be4118ab1dceff4e71c6afdbf;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/bip39-standalone.html b/bip39-standalone.html index 4bad422..0da2443 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html @@ -18467,7 +18467,12 @@ window.Entropy = new (function() { } // Work out the total number of bits for this many decks // See http://crypto.stackexchange.com/q/41886 - var gainedBits = Math.log2(factorial(52 * numberOfDecks)); + var gainedBits = 0; + // Equivalent of Math.log2(factorial(52*numberOfDecks)) + // which becomes infinity for numberOfDecks > 4 + for (var i=1; i<=52*numberOfDecks; i++) { + gainedBits = gainedBits + Math.log2(i); + } var lostBits = 52 * Math.log2(factorial(numberOfDecks)); var maxBits = gainedBits - lostBits; // Convert the drawn cards to a binary representation.