public function addHash($options)
    {
        if (is_string($options)) {
            $options = array($options);
        } else if (!is_array($options)) {

            throw new Zend_Validate_Exception("False parameter given");
        }

        $known = hash_algos();
        if (!isset($options['algorithm'])) {
            $algorithm = 'crc32';
        } else {
            $algorithm = $options['algorithm'];
            unset($options['algorithm']);
        }

        if (!in_array($algorithm, $known)) {

            throw new Zend_Validate_Exception("Unknown algorithm '{$algorithm}'");
        }

        foreach ($options as $value) {
            $this->_hash[$value] = $algorithm;
        }

        return $this;
    }
public function addHash($options)
    {
        if (is_string($options)) {
            $options = array($options);
        } else if (!is_array($options)) {

            throw new Zend_Validate_Exception("False parameter given");
        }

        $known = hash_algos();
        if (!isset($options['algorithm'])) {
            $algorithm = 'crc32';
        } else {
            $algorithm = $options['algorithm'];
            unset($options['algorithm']);
        }

        if (!in_array($algorithm, $known)) {

            throw new Zend_Validate_Exception("Unknown algorithm '{$algorithm}'");
        }

        foreach ($options as $value) {
            $this->_hash[$value] = $algorithm;
        }

        return $this;
    }
public function addHash ( $ options ) { if ( is_string ( $ options ) ) { $ options = array ( $ options ) ; } else if ( ! is_array ( $ options ) ) { throw new Zend_Validate_Exception ( "False parameter given" ) ; } $ known = hash_algos ( ) ; if ( ! isset ( $ options [ 'algorithm' ] ) ) { $ algorithm = 'crc32' ; } else { $ algorithm = $ options [ 'algorithm' ] ; unset ( $ options [ 'algorithm' ] ) ; } if ( ! in_array ( $ algorithm , $ known ) ) { throw new Zend_Validate_Exception ( "Unknown algorithm '{$algorithm}'" ) ; } foreach ( $ options as $ value ) { $ this -> _hash [ $ value ] = $ algorithm ; } return $ this ; }
Adds the hash for one or multiple files

@param  string|array $options
@return Zend_Validate_File_Hash Provides a fluent interface
Adds the hash for one or multiple files