According to the bep_0044, it should be possible to set an integer to MAX_INT64, (i.e. 0x7fffffffffffffff). libtorrent successfully bencode this number, although node-bencode doesn't allow this and I receive this error :
WARNING: Possible data corruption detected with value 9223372036854776000: Bencoding only defines support for integers, value was converted to 0
Which is fairly normal as my number is too big.
At the moment I hacked the number encoding case to push a hand crafted buffer when I detect an overflow, but it's not pretty at all... I don't see any easy solution, apart from using a library dedicated to handling large numbers, like node-int64.
Any thoughts ?
Cheers !
According to the bep_0044, it should be possible to set an integer to MAX_INT64, (i.e. 0x7fffffffffffffff). libtorrent successfully bencode this number, although node-bencode doesn't allow this and I receive this error :
Which is fairly normal as my number is too big.
At the moment I hacked the number encoding case to push a hand crafted buffer when I detect an overflow, but it's not pretty at all... I don't see any easy solution, apart from using a library dedicated to handling large numbers, like node-int64.
Any thoughts ?
Cheers !