From 73658669b5e5537e34f8a257b3eac40f77b9d186 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Thu, 30 May 2024 00:44:24 +0800 Subject: [PATCH 1/4] Update bep_0052.rst --- beps/bep_0052.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/beps/bep_0052.rst b/beps/bep_0052.rst index ddfd4d6..725eb1a 100644 --- a/beps/bep_0052.rst +++ b/beps/bep_0052.rst @@ -80,6 +80,7 @@ bencoding 'spam': 'eggs'} and ``d4:spaml1:a1:bee`` corresponds to {'spam': ['a', 'b']}. Keys must be strings and appear in sorted order (sorted as raw strings, not alphanumerics). + Duplicate keys are not allowed, for example ``d3:keyi1e3:keyi2ee`` Note that in the context of bencoding strings including dictionary keys From 2b72fe17ed27bca49d34d0770b7264ac0c224fb8 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Thu, 30 May 2024 01:00:42 +0800 Subject: [PATCH 2/4] Update bep_0052.rst --- beps/bep_0052.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/beps/bep_0052.rst b/beps/bep_0052.rst index 725eb1a..2d58c60 100644 --- a/beps/bep_0052.rst +++ b/beps/bep_0052.rst @@ -80,7 +80,10 @@ bencoding 'spam': 'eggs'} and ``d4:spaml1:a1:bee`` corresponds to {'spam': ['a', 'b']}. Keys must be strings and appear in sorted order (sorted as raw strings, not alphanumerics). - Duplicate keys are not allowed, for example ``d3:keyi1e3:keyi2ee`` + Duplicate keys in same directory are not allowed, + for example ``d3:keyi1e3:keyi2ee``. + But same keys in different directory doesn't have this limitation, + for example, `{'cow': 'moo', 'spam': {'cow': 'eggs'}}` Note that in the context of bencoding strings including dictionary keys From c9213c39d763a8c452484a844f5b1f6ae2026ef0 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Thu, 30 May 2024 01:06:39 +0800 Subject: [PATCH 3/4] Update bep_0052.rst --- beps/bep_0052.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/beps/bep_0052.rst b/beps/bep_0052.rst index 2d58c60..2c11dd9 100644 --- a/beps/bep_0052.rst +++ b/beps/bep_0052.rst @@ -75,15 +75,11 @@ bencoding corresponds to ['spam', 'eggs']. - Dictionaries are encoded as a 'd' followed by a list of alternating - keys and their corresponding values followed by an 'e'. For example, + unique keys and their corresponding values followed by an 'e'. For example, ``d3:cow3:moo4:spam4:eggse`` corresponds to {'cow': 'moo', 'spam': 'eggs'} and ``d4:spaml1:a1:bee`` corresponds to {'spam': ['a', 'b']}. Keys must be strings and appear in sorted order (sorted as raw strings, not alphanumerics). - Duplicate keys in same directory are not allowed, - for example ``d3:keyi1e3:keyi2ee``. - But same keys in different directory doesn't have this limitation, - for example, `{'cow': 'moo', 'spam': {'cow': 'eggs'}}` Note that in the context of bencoding strings including dictionary keys From af9f730ab99976255d609e3c5f122dfca40d5d67 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Thu, 30 May 2024 01:16:33 +0800 Subject: [PATCH 4/4] update bep003 also --- beps/bep_0003.html | 2 +- beps/bep_0003.rst | 2 +- beps/bep_0052.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/beps/bep_0003.html b/beps/bep_0003.html index e01f8bc..10de6bc 100644 --- a/beps/bep_0003.html +++ b/beps/bep_0003.html @@ -112,7 +112,7 @@

bencoding

bencoded) followed by an 'e'. For example l4:spam4:eggse corresponds to ['spam', 'eggs'].
  • Dictionaries are encoded as a 'd' followed by a list of alternating -keys and their corresponding values followed by an 'e'. For example, +unique keys and their corresponding values followed by an 'e'. For example, d3:cow3:moo4:spam4:eggse corresponds to {'cow': 'moo', 'spam': 'eggs'} and d4:spaml1:a1:bee corresponds to {'spam': ['a', 'b']}. Keys must be strings and appear in sorted order diff --git a/beps/bep_0003.rst b/beps/bep_0003.rst index 82c7039..e1b27da 100644 --- a/beps/bep_0003.rst +++ b/beps/bep_0003.rst @@ -69,7 +69,7 @@ bencoding corresponds to ['spam', 'eggs']. - Dictionaries are encoded as a 'd' followed by a list of alternating - keys and their corresponding values followed by an 'e'. For example, + unique keys and their corresponding values followed by an 'e'. For example, ``d3:cow3:moo4:spam4:eggse`` corresponds to {'cow': 'moo', 'spam': 'eggs'} and ``d4:spaml1:a1:bee`` corresponds to {'spam': ['a', 'b']}. Keys must be strings and appear in sorted order diff --git a/beps/bep_0052.html b/beps/bep_0052.html index 08ce95d..53b833d 100644 --- a/beps/bep_0052.html +++ b/beps/bep_0052.html @@ -114,7 +114,7 @@

    bencoding

    bencoded) followed by an 'e'. For example l4:spam4:eggse corresponds to ['spam', 'eggs'].
  • Dictionaries are encoded as a 'd' followed by a list of alternating -keys and their corresponding values followed by an 'e'. For example, +unique keys and their corresponding values followed by an 'e'. For example, d3:cow3:moo4:spam4:eggse corresponds to {'cow': 'moo', 'spam': 'eggs'} and d4:spaml1:a1:bee corresponds to {'spam': ['a', 'b']}. Keys must be strings and appear in sorted order