webtorrent / webtorrent/node-bencode
Integers should have no size limitation.
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 173
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
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.
yourdecode("i9007199254740991e") === yourdecode("i9007199254740992e")
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/decode.js at lines 18-28 and reproduce the example showing that two large integer inputs decode identically. Check the existing decoder behavior and determine how the implementation will honor the specification, either by preserving large integers or rejecting them. Done means large integer inputs are no longer silently corrupted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100