I found a workaround.
You can use the BigInteger.js
library with slight modifications for use in server-side JS with Classic ASP.
https://raw.githubusercontent.com/peterolson/BigInteger.js/master/BigInteger.js
For use in classic asp, do the following:
Modify line 21 and 28 of the BigInteger.js
library so it will work server side with classic ASP:
Change Line 21:
BigInteger.prototype = Object.create(Integer.prototype);
To:
BigInteger.prototype = new Object(Integer.prototype);
And make the same change to line 28.
Then, remove the last 4 lines. They are not needed:
// Node.js check
if (typeof module !== "undefined" && module.hasOwnProperty("exports")) {
module.exports = bigInt;
}
Then in your script include it like this:
<script language="javascript" runat="server">
... the bigInteger.js code...
function bitOrJS(a, b) {
var big = new bigInt(a);
return big.or(b);
}
</script>
You can now use the function in the classic ASP vbscript code:
Dim result
result = bitOrJS(2147483648, 2)
response.write result
Output will be 2147483650
as expected.