As of now BigInt isnt natively supported on React-Native Android so I am trying to use this as a polyfill. I could be wrong but it seems arithmetic bit shift operators don't work correctly.
const BigInt = require('big-integer');
const a = BigInt(80);
const b = BigInt(32);
console.log(a >> b); // This prints 0n on native BigInt, but 80 on this BigInt.
console.log(a.shiftRight(b)); // This prints Integer { value: 0n } expectedly though
Seems like I would need to use shiftLeft and shiftRight instead? Thats gonna be tough as BigInt is being used in another encoding lib that I wouldnt want to manually modify.
As of now BigInt isnt natively supported on React-Native Android so I am trying to use this as a polyfill. I could be wrong but it seems arithmetic bit shift operators don't work correctly.
Seems like I would need to use
shiftLeft
andshiftRight
instead? Thats gonna be tough as BigInt is being used in another encoding lib that I wouldnt want to manually modify.