lib/bagit.php
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->tagManifest->setHashEncoding($hashAlgorithm);
        }
    }
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->tagManifest->setHashEncoding($hashAlgorithm);
        }
    }
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 -> tagManifest -> setHashEncoding ( $ hashAlgorithm ) ; } }
Sets the bag's checksum hash algorithm.

@param string $hashAlgorithm The bag's checksum hash algorithm. Must be
either 'sha1' or 'md5'.

@return void
Sets the bag s checksum hash algorithm .