node-bencode icon indicating copy to clipboard operation
node-bencode copied to clipboard

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

Open hacknlove opened this issue 4 years ago • 2 comments

… '%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?

hacknlove avatar Aug 02 '21 13:08 hacknlove

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

welcome[bot] avatar Aug 02 '21 13:08 welcome[bot]

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

DiegoRBaquero avatar Oct 29 '21 14:10 DiegoRBaquero

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

hacknlove avatar Nov 28 '22 11:11 hacknlove