Right hash for sample.torrent, get error when pushing to the git repo

I’m stuck on Stage #RB2.

when calculating the hash of the sample.torrent, I get the correct result.
I wanted to try to do my own encoding and decoding, but when I upload I get the wrong hash
here is a repo with the code

I suspect its the bencode encode function thats doing something strange, but then I shouldnt get the sample.torrent correctly..

any help would be appreciated

Hey @jb-san, looks like the pieces field isn’t being encoded properly:

Let me know if you’d like help digging into that!

Thanks, I got it working, I was trying to parse it into a serde_json value and then pick out the values from that, that caused an issue with the pieces part, so i just made a more strict decoding straight into the Torrent struct

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.