bitcoin-transaction-size-calculator
bitcoin-transaction-size-calculator copied to clipboard
Just for record, the number 18446744073709551615 in getSizeOfVarInt() is not working as intended
JavaScript uses the IEEE 754 double-precision floating-point format for numbers, 18446744073709551615 is larger than this maximum safe integer value. Specifically, it's the maximum value for a 64-bit unsigned integer, which JavaScript does not handle precisely with its standard number type. You can make this test on your browser console, just type the number and it will show 18446744073709552000 instead.
We would need to change the code to work with the BigInt type to handle such large integers. This issue was created just 4 fun 😝