Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guarantee sorted keys when bencoding Dict (fixes #520) #521

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cypheon
Copy link

@cypheon cypheon commented Mar 30, 2021

BEP 3 requires dictionaries' keys to be in sorted order. Since Go's map
traversal is not guaranteed to be in alphabetical order, the keys need
to be copied and sorted before bencoding the key-value pairs.

This fixes #520

BEP 3 requires dictionaries' keys to be in sorted order.  Since Go's map
traversal is not guaranteed to be in alphabetical order, the keys need
to be copied and sorted before bencoding the key-value pairs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bencoded dictionaries' keys are not always sorted
1 participant