Jump to content

Pradeep Sharma

New Members
  • Posts

    1
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Pradeep Sharma's Achievements

New User

New User (1/3)

0

Reputation

  1. Hi everyone, I am working on a summer project to create a torrent client with nodejs and is stuck on how to calculate the infoHash I have read multiple article like https://wiki.theory.org/BitTorrentSpecification#Metainfo_File_Structure, https://www.bittorrent.org/beps/bep_0003.html and with what I understood I implemented a naive approach But It's not giving me the correct hash. So if you can please look my algorithm and suggest what I am not doing correctly would we a great help. Explanation:- It's a very naive approach, First I am calculating the infoDict length by encoding the info dict that I obtained from decoding the torrent file and then I am finding the substring from the torrent file which starts with 4:infod and has length same as we calculated earlier. I also have added an offset of 12 to ignore the 4:info. I am doing all this in hex codes because of this stack overflow thread https://stackoverflow.com/questions/28348678/what-exactly-is-the-info-hash-in-a-torrent-file. But still my Info hash value is not correct I am debugging my code using the info hash provided on the link below:- https://linuxtracker.org/index.php?page=torrent-details&id=5a9ee290c86148fcd00dead9dd225848d9fd0d7a If you want to see my complete code and check for yourself. You can use this github link(https://github.com/pradeepsh2203/bit-torrent/). I would be really helpful If you can help me with this
×
×
  • Create New...