/** * 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); }