create and verify hash files (manifests)

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 1

Open Issues: 1

pkg:composer/ottosmops/hash

v1.2.0 2020-06-30 08:36 UTC

This package is auto-updated.

Last update: 2025-10-10 18:40:12 UTC


README

Software License Latest Stable Version Build Status SensioLabsInsight Packagist Downloads

Installation

composer require ottosmops/hash

Usage

use Ottosmops\Hash\Hash;

$hash = New Hash(); // you can pass an algorithm into the constructor
$hash->createManifest($dir);
if (!$hash->verifyManifest($dir . 'manifest')) {
    print_r($this->messages);
} else {
    echo  sprintf('All files in %s have correct checksums ', $hash->manifest); 
}

You can pass a filename to the createManifest method. The filename must be a path relative to the dir. With the third parameter you can switch off the recursive directory iterator. No subdirectories will be scanned:

$md5 = New Hash();
$md5->createManifest($dir, "myfilename", false);

License

The MIT License (MIT). Please see License File for more information.