ChainSafe / fixed-sized-numbers-ts

Fixed Sized BigNumbers in TypeScript
2 stars 4 forks source link

Support bignumber<->Buffer conversion #18

Open wemeetagain opened 5 years ago

wemeetagain commented 5 years ago

bignumber.js does not have methods for converting between bignumbers and byte arrays (like Buffer). See closed issues here and here

Add conversion methods (that parameterize on endianness) or use an alternative bignumber library that provides methods natively. The ssz-js library currently uses bn.js Related to ssz-js issue #20

TimDaub commented 2 years ago

If I may ask, how are you working around this limitation? I'm currently thinking of how to encode Solidity's uint256 into a binary format for storing it in files.

wemeetagain commented 2 years ago

We now use native bigint instead of this library. And use this library https://github.com/no2chem/bigint-buffer to do conversions.