public function setHash($options) { if (!is_array($options)) { $options = (array) $options; } $options['algorithm'] = 'md5'; parent::setHash($options); return $this; }
public function setHash($options) { if (!is_array($options)) { $options = array($options); } $options['algorithm'] = 'crc32'; parent::setHash($options); return $this; }
/** * Ensures that setHash() returns expected value * * @return void */ public function testSetHash() { $validator = new Zend_Validate_File_Hash('12345'); $validator->setHash('12333'); $this->assertEquals(array('12333' => 'crc32'), $validator->getHash()); $validator->setHash(array('12321', '12121')); $this->assertEquals(array('12321' => 'crc32', '12121' => 'crc32'), $validator->getHash()); }
/** * Sets the md5 hash for one or multiple files * * @param string|array $hash Hash to check for * @param string $algorithm (Depreciated) Algorithm to use, fixed to md5 * @return Zend_Validate_File_Hash Provides a fluent interface */ public function setHash($hash, $algorithm = 'md5') { parent::setHash($hash, 'md5'); return $this; }