networkinfo Posted August 21, 2013 Report Share Posted August 21, 2013 HelloFrom a torrent exampled8:announce27:http://example.com/announce7:comment7:Example10:created by13:uTorrent/181013:creation datei1232326057e8:encoding5:UTF-84:infod6:lengthi7660e4:name11:torrent.php12:piece lengthi65536e6:pieces20:7vEȹœ£“h‰Éâ:WzEpeeI try to calculate the hashsha1('d6:lengthi7660e4:name11:torrent.php12:piece lengthi65536e6:pieces20:7vEȹœ£“h‰Éâ:WzEpe');It gives me d25b89e241afc48b9e1cf20d46a9d13f05d41634 but the hash is c402e422692f67685c634870eba87eaece044996What am i doing wrong ?Thank in advance Link to comment Share on other sites More sharing options...
ciaobaby Posted August 21, 2013 Report Share Posted August 21, 2013 The hashsum is created from the DATA. Link to comment Share on other sites More sharing options...
networkinfo Posted August 21, 2013 Author Report Share Posted August 21, 2013 Oh !Can you explain me ? i don't understand ...I understand the bencode format but the hash give me trouble ! Link to comment Share on other sites More sharing options...
ciaobaby Posted August 21, 2013 Report Share Posted August 21, 2013 I understand the bencode format but the hash give me trouble !two different things.https://wiki.theory.org/BitTorrentSpecificationhttp://en.wikipedia.org/wiki/Checksum Link to comment Share on other sites More sharing options...
networkinfo Posted August 21, 2013 Author Report Share Posted August 21, 2013 The hashsum is created from the DATA.The data of the file ? info_hash: urlencoded 20-byte SHA1 hash of the value of the info key from the Metainfo file. Note that the value will be a bencoded dictionary, given the definition of the info key above. I have to find the hashsum not the info_hash????I'm trying to create a torrent form a file in php Link to comment Share on other sites More sharing options...
ciaobaby Posted August 21, 2013 Report Share Posted August 21, 2013 The data of the file ?BitTorrent doesn't have a concept of fileshttp://forum.utorrent.com/viewtopic.php?pid=703034#p703034 Link to comment Share on other sites More sharing options...
networkinfo Posted August 21, 2013 Author Report Share Posted August 21, 2013 Sorry i don't understand and i search for several weekMaybe it's because im french and my english is not enough goodI'd like to generate a torrent file from a file simply like this d8:announce27:http://example.com/announce7:comment7:Example10:created by13:uTorrent/181013:creation datei1232326057e8:encoding5:UTF-84:infod6:lengthi7660e4:name11:torrent.php12:piece lengthi65536e6:pieces20:7vEȹœ£“h‰Éâ:WzEpeeAltough i read bittorent protocol i don-t understant this part 7vEȹœ£“h‰Éâ:WzEpeIt is the sha1 of what exactly ?I have read all that i found, can you help me ? Link to comment Share on other sites More sharing options...
Kitsoran Posted August 25, 2013 Report Share Posted August 25, 2013 infohash, specifically a hash of the value of the info dictionary contained within the .torrent. You don't hash the whole file... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.