title: Generate info_hash of torrent for xbtt
body: <p>I am trying to create my own torrent tracker but dont know how to generate <code>info_hash</code> that is used <code>xbtt</code> to track torrents.</p>
  
  <p>Is this possible with php?</p>
  
  <p>I am using this function to bencode and decode <a href="http://paste.lisp.org/display/17178" rel="nofollow noreferrer">http://paste.lisp.org/display/17178</a></p>
  
  <p>Is this the correct hash?</p>
  
  <pre><code>$nn = file_get_contents('my.torrent');
  $file = bdecode($nn);
  $hash = sha1( bencode($file[info]) );
  </code></pre>
  
  <p>Thank You.</p>