When using the .toString('hex') and .toString(16) methods on a BN object, the returned value doesn't seem to represent the correct hexadecimal format of the number. Instead, it's simply returning the decimal value as a string.
Code Sample
With bn.js:
console.log(
"BN result",
new BN(100).toString("hex"),
new BN(100).toString(16),
);
// Expected LOG: BN result 64 64
With react-native-bignumber:
console.log(
"BN result",
new BN(100).toString("hex"),
new BN(100).toString(16),
);
// Actual LOG: BN result 100 100
When using the
.toString('hex')
and.toString(16)
methods on a BN object, the returned value doesn't seem to represent the correct hexadecimal format of the number. Instead, it's simply returning the decimal value as a string.Code Sample
With
bn.js
:With
react-native-bignumber
:Env info: