]> git.ardis.lu - block-hash-calculator/commitdiff
Populate block number input if no value is provided
authorArdis Lu <ardisglu@gmail.com>
Sun, 31 May 2026 06:29:44 +0000 (23:29 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 31 May 2026 06:29:44 +0000 (23:29 -0700)
index.html

index 6096508954f3c12074b39877b96c84dd7997b582..24a04a22ac6c02ec7dc00de6c46f9b938afe9ef4 100644 (file)
@@ -92,6 +92,9 @@
         document.querySelector('#out-header').textContent = JSON.stringify(header, (_, v) => typeof v === 'bigint' ? v.toString() : v, 2).replaceAll('"', '');
         document.querySelector('#out-encoded').textContent = encoded;
         document.querySelector('#out-hash').textContent = hash;
+        if (num === '') {
+          e.target.elements.num.value = Number(block.number);
+        }
       }
       document.querySelector('output').style.setProperty('display', 'unset');
 
This page took 0.032133 seconds and 4 git commands to generate.