You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var Base62=require('base62');
var maxv= Base62.decode("ZZZZZZZZZZ");
var mmaxv = Base62.encode(maxv);
console.log("maxv=" +maxv+" mmaxv="+mmaxv);
> maxv=839299365868340200 mmaxv=10000000000
The text was updated successfully, but these errors were encountered:
This is due to the numbers being represented in JavaScript as IEEE 754 double-precision binary floating-point (wiki) thus being only able to precisely represent integers up to 53 bits long (the value of Number.MAX_SAFE_INTEGER, or Math.pow(2, 53) - 1).
The only way to bypass that would be to use custom number representation such as the bignum and big-integer modules. Some other base64 modules (b64) base62 modules (b62) are doing just that, but it comes at a cost.
The text was updated successfully, but these errors were encountered: