node-bencode
node-bencode copied to clipboard
Integers should have no size limitation.
trafficstars
Bug: it fails to satisfy the specification.
BEP 52 — The BitTorrent protocol specification version 2
Integers have no size limitation.
Currently, node-bencode allows decoded integer data to be corrupted. It should either use bigints or throw on a long integer input.
https://github.com/webtorrent/node-bencode/blob/2fa2c7ea7d97791a0c7f0cb3dd0bb098c014738f/lib/decode.js#L18-L28
yourdecode("i9007199254740991e") === yourdecode("i9007199254740992e")