webtorrent / node-bencode

bencode de/encoder for nodejs
MIT License
166 stars 36 forks source link

use '-' instead of ':' so it can be used in query parameters wihtout … #104

Closed hacknlove closed 2 years ago

hacknlove commented 3 years ago

… '%3A' at every string delimitator

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update [ ] Bug fix [x] New feature [ ] Other, please explain:

What changes did you make? (Give an overview) It allows to encode/decode using '-' as string delimitator, so it plays nicer with urls

encodeURIComponent replaces ':' with '%3Awhich makes the url longer and ugglier but it allows'-'`

Which issue (if any) does this pull request address?

I just wanted to serialize some data I want to send as a query parameter in the shortest and nicest way possible. I though of bencode but I realized it could be better for urls if we use - instead of :

So it only requires you to run

Is there anything you'd like reviewers to focus on?

welcome[bot] commented 3 years ago

🙌 Thanks for opening this pull request! You're awesome.

DiegoRBaquero commented 3 years ago

can you remove the package-lock.json file and the package.json changes?

hacknlove commented 2 years ago

I don't need this anymore. I close it to clean my open PRs list.