Open tadeubas opened 2 months ago
Is it actually possible to trigger this overflow via the form, though?
Looks like the max value we allow for each integer input field is 99999 and even when I max that out on every field, none of the math ends up approaching anywhere near javascript's max integer.
Sure, it was 4 fun because this value exists in the code here: https://github.com/jlopp/bitcoin-transaction-size-calculator/blob/master/index.html#L68
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 show18446744073709552000
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 😝