AElfProject / aelf-web3.js

aelf JavaScript SDK
MIT License
16 stars 24 forks source link

Need to encode using signed integer #18

Closed gldeng closed 5 years ago

gldeng commented 5 years ago

Signed integers are to be transmitted in sint64 or sint32 format. Otherwise, the decoded value will be half of the intended value.

https://github.com/AElfProject/aelf-sdk.js/blob/de7e9599b11b871f15e73386f1754f1f792a97a5/lib/aelf/types/formatters.js#L86

hzz780 commented 5 years ago

https://imweb.io/topic/581a8eb02373d1aa606c8be7

https://github.com/dcodeIO/long.js

yep

When deal with int64.

Long.js is solution of Protobuf.js to solve the problem of int64 in javascript.