Page 1 of 1

Get the InfoHash before the tracker work

Posted: 26 Dec 2010, 06:47
by Seraph
We know that when the tracker begin to work, the server will get the InfoHash from the tracker and write it to the mySQL database, and then we can get the InfoHash from the database...
But to get the InfoHash before the tracker work download this
Then copy BEncode.php and BDecode.php to your server's root directory or new folder.

Then use this code to view the infohash:

Code: Select all

<?php

include('./BDecode.php');
include('./BEncode.php');

$tfile = BDecode(file_get_contents("/path/to/torrent/file.torrent"));
$infohash = sha1(BEncode($tfile["info"]));
echo $infohash;

?>