]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Card bits per event is shown as the average value
authorIan Coleman <coleman.ian@gmail.com>
Wed, 30 Nov 2016 07:37:00 +0000 (18:37 +1100)
committerIan Coleman <coleman.ian@gmail.com>
Wed, 30 Nov 2016 07:38:29 +0000 (18:38 +1100)
bip39-standalone.html
src/js/index.js

index e8aaaa6583b45c04b1a22d43230138c800c1d039..e433d3194752c1610d798c155aeca64293129518 100644 (file)
@@ -19368,7 +19368,7 @@ window.Entropy = new (function() {
         var wordCount = Math.floor(numberOfBits / 32) * 3;
         var bitsPerEvent = Math.log2(entropy.base.asInt).toFixed(2);
         if (entropy.base.asInt == 52) {
-            bitsPerEvent = bitsPerEvent + " (or less)";
+            bitsPerEvent = (4.3381).toFixed(2); // log2(52! / 52)
         }
         DOM.entropyFiltered.html(entropy.cleanHtml);
         DOM.entropyType.text(entropyTypeStr);
index ea07dca3e858f64148510cecac2571a3a01f0081..12788ab3da7b41620ac6f7ad08a0c2997d5148e8 100644 (file)
         var wordCount = Math.floor(numberOfBits / 32) * 3;
         var bitsPerEvent = Math.log2(entropy.base.asInt).toFixed(2);
         if (entropy.base.asInt == 52) {
-            bitsPerEvent = bitsPerEvent + " (or less)";
+            bitsPerEvent = (4.3381).toFixed(2); // log2(52! / 52)
         }
         DOM.entropyFiltered.html(entropy.cleanHtml);
         DOM.entropyType.text(entropyTypeStr);