Example #1
0
 /**
  * Get the hash of the torrent file
  *
  * @param boolean $raw Set to true to return the raw 20-byte hash
  * @return string The torrent hash
  * @throws RuntimeException
  */
 public function getHash($raw = false)
 {
     $info = $this->getInfoPart();
     $encoder = new Encoder();
     return sha1($encoder->encodeDictionary($info), $raw);
 }
Example #2
0
 function render()
 {
     $encoder = new Encoder();
     return $encoder->encode($this->response);
 }