1️⃣ Base Stage
Decode bencoded integers
Decode bencoded lists
Decode bencoded dictionaries
Parse torrent file
Calculate info hash
Piece hashes
Discover peers
Peer handshake
Download a piece
Download the whole file
2️⃣ Magnet Links
Parse magnet link
Announce extension support
Send extension handshake
Receive extension handshake
Download a piece
Download the whole file
log
[compile] -- Running vcpkg install
[compile] All requested packages are currently installed.
[compile] All requested installations completed successfully in: 85 us
[compile] -- Running vcpkg install - done
[compile] -- Configuring done (0.0s)
[compile] -- Generating done (0.0s)
[compile] -- Build files have been written to: /app/build
[compile] [ 50%] Building CXX object CMakeFiles/bittorrent.dir/src/main.cpp.o
[compile] In file included from /app/src/main.cpp:112:
[compile] /app/src/lib/nlohmann/json.hpp:24329:34: warning: space between quotes and suffix is deprecated in C++23 [-Wdeprecated-literal-operator]
[compile] 24329 | inline nlohmann::json operator "" _json(const char* s, std::size_t n)
[compile] | ^~
[compile] | --
[compile] /app/src/lib/nlohmann/json.hpp:24329:34: warning: space between quotes and suffix is deprecated in C++23 [-Wdeprecated-literal-operator]
[compile] 24329 | inline nlohmann::json operator "" _json(const char* s, std::size_t n)
[compile] | ^~
[compile] | --
[compile] /app/src/lib/nlohmann/json.hpp:24337:48: warning: space between quotes and suffix is deprecated in C++23 [-Wdeprecated-literal-operator]
[compile] 24337 | inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n)
[compile] | ^~
[compile] | --
[compile] /app/src/lib/nlohmann/json.hpp:24337:48: warning: space between quotes and suffix is deprecated in C++23 [-Wdeprecated-literal-operator]
[compile] 24337 | inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n)
[compile] | ^~
[compile] | --
[compile] /app/src/lib/nlohmann/json.hpp:24401:57: warning: space between quotes and suffix is deprecated in C++23 [-Wdeprecated-literal-operator]
[compile] 24401 | using nlohmann::literals::json_literals::operator "" _json; // NOLINT(misc-unused-using-decls,google-global-names-in-headers)
[compile] | ^~
[compile] | --
[compile] /app/src/lib/nlohmann/json.hpp:24401:57: warning: space between quotes and suffix is deprecated in C++23 [-Wdeprecated-literal-operator]
[compile] 24401 | using nlohmann::literals::json_literals::operator "" _json; // NOLINT(misc-unused-using-decls,google-global-names-in-headers)
[compile] | ^~
[compile] | --
[compile] /app/src/lib/nlohmann/json.hpp:24402:57: warning: space between quotes and suffix is deprecated in C++23 [-Wdeprecated-literal-operator]
[compile] 24402 | using nlohmann::literals::json_literals::operator "" _json_pointer; //NOLINT(misc-unused-using-decls,google-global-names-in-headers)
[compile] | ^~
[compile] | --
[compile] /app/src/lib/nlohmann/json.hpp:24402:57: warning: space between quotes and suffix is deprecated in C++23 [-Wdeprecated-literal-operator]
[compile] 24402 | using nlohmann::literals::json_literals::operator "" _json_pointer; //NOLINT(misc-unused-using-decls,google-global-names-in-headers)
[compile] | ^~
[compile] | --
[compile] [100%] Linking CXX executable bittorrent
[compile] [100%] Built target bittorrent
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[your_program] Tracker URL: http://127.0.0.1:43377/announce
[your_program] Length: 636505
[your_program] Info Hash: ad42ce8109f54c99613ce38f9b4d87e70f24a165
[your_program] Piece Length: 262144
[your_program] Piece Hashes:
[your_program] 3b46a96d9bc3716d1b75da91e6d753a793ad1cef
[your_program] eda417cb5c1cdbf841125c412da0bec9db8301f3
[your_program] 422f45b1052e2d45da3e2a6516e1bb1f1db00733
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[your_program] Tracker URL: http://127.0.0.1:36953/announce
[your_program] Length: 636505
[your_program] Info Hash: ad42ce8109f54c99613ce38f9b4d87e70f24a165
[your_program] Piece Length: 262144
[your_program] Piece Hashes:
[your_program] 3b46a96d9bc3716d1b75da91e6d753a793ad1cef
[your_program] eda417cb5c1cdbf841125c412da0bec9db8301f3
[your_program] 422f45b1052e2d45da3e2a6516e1bb1f1db00733
[tester::
[tester::
[tester::
[your_program] Peer ID: 2926f6ad44883b80429d2e90d86772f6bdcd81c0
[your_program] Peer Metadata Extension ID: 206
[tester::
[tester::
[tester::
[tester::
[tester::
[your_program] Peer ID: eb3880ed07a5848fa8dfcb6426d0c91c63a4bd2a
[your_program] Peer Metadata Extension ID: 63
[tester::
[tester::
[tester::
[your_program] Peer ID: 39a78ce66c3922cb24f6387e0504658ab243753a
[your_program] Peer Metadata Extension ID: 52
[tester::
[tester::
[tester::
[your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] Info Hash: c5fb9894bdaba464811b088d806bdd611ba490af
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[your_program] Peer ID: a2def9afe1ba96ab0af3f5e64d1ba818a80d3859
[tester::
[tester::
[tester::
[your_program] 188.119.61.177:6881
[your_program] 185.107.13.235:54542
[your_program] 88.99.2.101:6881
[tester::
[tester::
[tester::
[your_program] Tracker URL: http://bttracker.debian.org:6969/announce
[your_program] Length: 1572864
[your_program] Info Hash: ad7f0629e6dd300006827699a4bfb8cfa14c7afc
[your_program] Piece Length: 262144
[your_program] Piece Hashes:
[your_program] a245894e110070f811aaa6f60820cd31786f8bc4
[your_program] 9370e822cc4749ef6d94000b9ac760caceb53d24
[your_program] f0e17035d8eaeee25f5f9e45b94a24eda77c7072
[your_program] 51fbf75ccd309de1eda3cdeba38f8947bef7a583
[your_program] f59bbe58562e71908c24f7dd2e81f70041adda3d
[your_program] 70edcac2611a8829ebf467a6849f5d8408d9d8f4
[tester::
[tester::
[tester::
[your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] Length: 820892
[your_program] Info Hash: 1cad4a486798d952614c394eb15e75bec587fd08
[your_program] Piece Length: 262144
[your_program] Piece Hashes:
[your_program] 3d42a20edb1cf840cd3528d3a9e921db6338a463
[your_program] 69f885b3988a52ffb03591985402b6d5285940ab
[your_program] 76869e6c9c1f101f94f39de153e468be6a638f4f
[your_program] bded68d02de011a2b687f75b5833f46cce8e3e9c
[tester::
[your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] Length: 2994120
[your_program] Info Hash: c77829d2a77d6516f88cd7a3de1a26abcbfab0db
[your_program] Piece Length: 262144
[your_program] Piece Hashes:
[your_program] 3c34309faebf01e49c0f63c90b7edcc2259b6ad0
[your_program] b8519b2ea9bb373ff567f644428156c98a1d00fc
[your_program] 9dc81366587536f48c2098a1d79692f2590fd9a6
[your_program] 033c61e717f8c0d1e55850680eb451e3543b6203
[your_program] 6f54e746ec369f65f32d45f77b1f1c37621fb965
[your_program] c656704b78107ed553bd0813f92fef780267c07b
[your_program] 7431b8683137d20ff594b1f1bf3f8835165d68fb
[your_program] 0432bd8e779608d27782b779c7738062e9b50ab5
[your_program] d6bc0409a0f3a9503857669d47fe752d4577ea00
[your_program] a86ee6abbc30cddb800a0b62d7a296111166d839
[your_program] 783f52b70f0c902d56196bd3ee7f379b5db57e3b
[your_program] 3d8db9e34db63b4ba1be27930911aa37b3f997dd
[tester::
[your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] Length: 2549700
[your_program] Info Hash: 70edcac2611a8829ebf467a6849f5d8408d9d8f4
[your_program] Piece Length: 262144
[your_program] Piece Hashes:
[your_program] 01cc17bbe60fa5a52f64bd5f5b64d99286d50aa5
[your_program] 838f703cf7f6f08d1c497ed390df78f90d5f7566
[your_program] 45bf10974b5816491e30628b78a382ca36c4e05f
[your_program] 84be4bd855b34bcedc0c6e98f66d3e7c63353d1e
[your_program] 86427ac94d6e4f21a6d0d6c8b7ffa4c393c3b131
[your_program] 7c70cd5f44d1ac5505cb855d526ceb0f5f1cd5e3
[your_program] 3796ab05af1fa874173a0a6c1298625ad47b4fe6
[your_program] 272a8ff8fc865b053d974a78681414b38077d7b1
[your_program] b07128d3a6018062bfe779db96d3a93c05fb81d4
[your_program] 7affc94f0985b985eb888a36ec92652821a21be4
[tester::
[tester::
[tester::
[your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] Length: 820892
[your_program] Info Hash: 1cad4a486798d952614c394eb15e75bec587fd08
[your_program] Piece Length: 262144
[your_program] Piece Hashes:
[your_program] 3d42a20edb1cf840cd3528d3a9e921db6338a463
[your_program] 69f885b3988a52ffb03591985402b6d5285940ab
[your_program] 76869e6c9c1f101f94f39de153e468be6a638f4f
[your_program] bded68d02de011a2b687f75b5833f46cce8e3e9c
[tester::
[tester::
[tester::
[tester::
[tester::
[tester::
[your_program] Logs from your program will appear here!
[your_program] {}
[tester::
[tester::
[your_program] {"foo":"banana","hello":52}
[your_program] Logs from your program will appear here!
[tester::
[tester::
[your_program] Logs from your program will appear here!
[your_program] {"inner_dict":{"key1":"value1","key2":42,"list_key":["item1","item2",3]}}
[tester::
[tester::
[tester::
[tester::
[your_program] Logs from your program will appear here!
[your_program] []
[tester::
[tester::
[your_program] Logs from your program will appear here!
[your_program] ["grape",637]
[tester::
[tester::
[your_program] Logs from your program will appear here!
[your_program] [[637,"grape"]]
[tester::
[tester::
[your_program] Logs from your program will appear here!
[your_program] [[4],5]
[tester::
[tester::
[tester::
[your_program] Logs from your program will appear here!
[your_program] 1062066884
[tester::
[your_program] Logs from your program will appear here!
[your_program] 4294967300
[tester::
[your_program] -52
[your_program] Logs from your program will appear here!
[tester::
[tester::
[tester::
[your_program] "banana"
[your_program] Logs from your program will appear here!
[tester::
[your_program] Logs from your program will appear here!
[your_program] "http://bittorrent-test-tracker.codecrafters.io/announce"
[tester::