#rb2 not able to compute info hash properly

i am stuck at #rb2 … my hash and test hashes are coming differently and i am not able to spot issues…i have unmarshalled the data into fileData struct and manually encode in bencoding format as you can see in below screens but i am confused why my hash is different.
can somebody help?

fileData struct:
type File struct {
Announce string json:"announce"
CreatedBy string json:"created by"
Info Info json:"info"
}
type Info struct {
Length int64 json:"length"
Name string json:"name"
PieceLength int64 json:"piece length"
Pieces string json:"pieces"
}

Hi @ankur12345678, could you upload your code to GitHub and share the link? It will be much easier to debug if I can run it directly.

Thanks for replying

Thanks for sharing the link! I’ll take a look and get back to you by the end of the week.

Sorry for the delayed response!

I tried running your code against the previous stages, but it’s actually no longer passing the stage #OW9 (Parse torrent file).

Suggestions:

  1. Use our CLI to test against previous stages by running:
codecrafters test --previous
  1. Focus on fixing the early stages first, as later stages depend on them.

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

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