I spent four hours debugging a JS prototype to finally realise:

parseInt('0xfedcba0987654321', 16).toString()

will silently return the wrong result (rounds off the last 3 digits to 0) because the hex is too long.

The solution:

BigInt('0xfedcba0987654321', 16).toString() pic.twitter.com/IJoP8IROYe

pic.twitter.com/IJoP8IROYe