JavaScript: Hex String To Int64 change (like Int64.parse)

As of late in our Node.js application we had an errand where we expected to change over the Windows hexadecimal Live Id (top) to moaned 64 digit Integer to such an extent that it tends to be utilized in the API calls. Yet, there was no immediate method for changing over that in JavaScript, yet here I will talk about the workaround we took.

The issue with 64 digit Integer in JavaScript
HoweverjavaScript numbers are best string to hex 64 digit yet they just utilize 53 pieces to store the genuine value(mantissa), rest pieces are utilized for example. Subsequently this makes holding of 64bit whole number inconceivable in JavaScript.

The workaround Solution
The workaround is to utilize String/Arrays to hold huge numbers and perform number-crunching procedure on that. The end-product must be saved in a string as we can never save it as number information type. I realize it is grimy, yet that is the main way.

Leave a comment

Design a site like this with WordPress.com
Get started