decode without using the entire input
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- backend
Research direction
Begin at the decode entry point and reproduce the supplied JavaScript example with multiple bencoded parts. The issue does not choose between returning the first part, raising an exception, or another behavior, so done requires a settled behavior for trailing input and agreement on how it should be communicated.
Written by the indexing model from the issue text.
Description
Not sure if this is a bug or not but I'd like to discuss how decode should behave when we feed multiple parts.
Example:
bencode.decode('i123ei123e', 'utf8'); // 123
The input has more data than that. When we use the decode function, it silently returns just the first decoded part. Is this intended?
I saw some cases where a single buffer they wanted to decode had multiple bencoded parts (it was some data received from the network they had no control over). And when they used this lib, it was silently missing parts. So they had to implement some logic to check if the decoded result was everything the input had or not. They managed to get everything working, but I'm wondering if the lib should give a heads up (exception or whatever) when this happens.
- Dominant language
- JavaScript
- Stars
- 173
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
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.
More from webtorrent/node-bencode
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
webtorrent/node-bencode#162 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
webtorrent/node-bencode#178 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
webtorrent/node-bencode#146 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
webtorrent/node-bencode#143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
webtorrent/node-bencode#142 ·
All issues in webtorrent/node-bencode
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·