Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Zend Validator Laravel Package

zendframework/zend-validator

Powerful validation library from Zend Framework for PHP apps. Provides a wide range of reusable validators, input filtering, and custom rule support with clear error messages. Integrates easily into forms and domain validation workflows.

View on GitHub
Deep Wiki
Context7

Hash

Zend\Validator\File\Hash allows you to validate if a given file's hashed contents matches the supplied hash(es) and algorithm(s).

Requires the hash extension

This validator requires the PHP Hash extension. A list of supported hash algorithms can be found with the hash_algos() function.

Supported Options

The following set of options are supported:

  • hash: String hash or array of hashes against which to test.
  • algorithm: String hashing algorithm to use; defaults to crc32

Basic Usage

use Zend\Validator\File\Hash;

// Does file have the given hash?
$validator = new Hash('3b3652f', 'crc32');

// Or, check file against multiple hashes
$validator = new Hash(['3b3652f', 'e612b69'], 'crc32');

// Or use options notation:
$validator = new Hash([
    'hash' => ['3b3652f', 'e612b69'],
    'algorithm' => 'crc32',
]);

// Perform validation with file path
if ($validator->isValid('./myfile.txt')) {
   // file is valid
}

Public Methods

getHash

getHash() : array

Returns an array containing the set of hashes against which to validate.

addHash

addHash(string|array $options) : void

Add one or more hashes against which to validate.

setHash

setHash(string|array $options) : void

Overwrite the current set of hashes with those provided to the method.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport