diff options
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/entropy.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/js/entropy.js b/src/js/entropy.js index b7274bb..24fc21a 100644 --- a/src/js/entropy.js +++ b/src/js/entropy.js | |||
@@ -263,7 +263,12 @@ window.Entropy = new (function() { | |||
263 | } | 263 | } |
264 | // Work out the total number of bits for this many decks | 264 | // Work out the total number of bits for this many decks |
265 | // See http://crypto.stackexchange.com/q/41886 | 265 | // See http://crypto.stackexchange.com/q/41886 |
266 | var gainedBits = Math.log2(factorial(52 * numberOfDecks)); | 266 | var gainedBits = 0; |
267 | // Equivalent of Math.log2(factorial(52*numberOfDecks)) | ||
268 | // which becomes infinity for numberOfDecks > 4 | ||
269 | for (var i=1; i<=52*numberOfDecks; i++) { | ||
270 | gainedBits = gainedBits + Math.log2(i); | ||
271 | } | ||
267 | var lostBits = 52 * Math.log2(factorial(numberOfDecks)); | 272 | var lostBits = 52 * Math.log2(factorial(numberOfDecks)); |
268 | var maxBits = gainedBits - lostBits; | 273 | var maxBits = gainedBits - lostBits; |
269 | // Convert the drawn cards to a binary representation. | 274 | // Convert the drawn cards to a binary representation. |