- Timestamp:
- 21.07.2005 12:58:22 (3 years ago)
- Files:
-
- 1 modified
-
trunk/infohash.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/infohash.php
r29 r36 3 3 /** 4 4 * Info-Hash Test 5 * Get Info from a .torrent file5 * Compares the info_hash compution of this package to the original program implementation 6 6 * 7 7 * Usage: … … 12 12 */ 13 13 14 error_reporting(E_ALL); 15 14 16 // Includes 15 17 require_once 'File/Bittorrent/Decode.php'; 16 require_once 'File/Bittorrent/Encode.php';17 18 require_once 'Console/Getargs.php'; 18 19 … … 38 39 39 40 $File_Bittorrent_Decode = new File_Bittorrent_Decode; 40 $File_Bittorrent_Encode = new File_Bittorrent_Encode; 41 $decoded = $File_Bittorrent_Decode->decode(file_get_contents($torrent)); 41 $File_Bittorrent_Decode->decodeFile($torrent); 42 42 43 43 echo "\nInfo Hash\n"; 44 44 echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"; 45 echo "This: " . sha1($File_Bittorrent_Encode->encode($decoded['info'])). "\n";46 45 echo "This: " . $File_Bittorrent_Decode->info_hash . "\n"; 46 47 47 exec('/usr/bin/btshowmetainfo.py ' . escapeshellarg($torrent), $bt); 48 48 echo "btshowmetainfo: " . substr($bt[3], strpos($bt[3], ':') + 2) . "\n"; 49 49 50 50 ?>