Exemplo n.º 1
0
 /**
  * Sets the bag's checksum hash algorithm.
  *
  * @param string $hashAlgorithm The bag's checksum hash algorithm. Must be
  * either 'sha1' or 'md5'.
  *
  * @return void
  */
 function setHashEncoding($hashAlgorithm)
 {
     $hashAlgorithm = strtolower($hashAlgorithm);
     if ($hashAlgorithm != 'md5' && $hashAlgorithm != 'sha1') {
         throw new InvalidArgumentException("Invalid hash algorithim: '{$hashAlgorithm}'.");
     }
     $this->manifest->setHashEncoding($hashAlgorithm);
     if ($this->tagManifest !== null) {
         $this->manifest->setHashEncoding($hashAlgorithm);
     }
 }