PHPackages                             innmind/hash - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. innmind/hash

ActiveLibrary[File &amp; Storage](/categories/file-storage)

innmind/hash
============

Files incremental hash

2.0.0(5mo ago)019.0k↓74.6%1MITPHPPHP ~8.4CI passing

Since Sep 24Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Innmind/hash)[ Packagist](https://packagist.org/packages/innmind/hash)[ Docs](http://github.com/innmind/hash)[ RSS](/packages/innmind-hash/feed)WikiDiscussions develop Synced 2d ago

READMEChangelog (7)Dependencies (5)Versions (13)Used By (1)

Hash
====

[](#hash)

[![Build Status](https://github.com/innmind/hash/workflows/CI/badge.svg?branch=master)](https://github.com/innmind/hash/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/0f29cc2b435569fb82be35eda4326b4a8e9517a5ecbbd4bf8238ab49e2905c7d/68747470733a2f2f636f6465636f762e696f2f67682f696e6e6d696e642f686173682f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/innmind/hash)[![Type Coverage](https://camo.githubusercontent.com/64fcddee0584f122d7658437226f3c3bd5dc9faab1d57adfb03d99ed2ae8de75/68747470733a2f2f73686570686572642e6465762f6769746875622f696e6e6d696e642f686173682f636f7665726167652e737667)](https://shepherd.dev/github/innmind/hash)

This component allows to incrementally compute the hash of a file (or any sequence of strings).

Installation
------------

[](#installation)

```
composer require innmind/hash
```

Usage
-----

[](#usage)

```
use Innmind\OperatingSystem\Factory;
use Innmind\Url\Path;
use Innmind\Hash\{
    Hash,
    Value,
};
use Innmind\Immutable\Set;

$hashes = Factory::build()
    ->filesystem()
    ->mount(Path::of('some-folder/'))
    ->all()
    ->map(Hash::sha512->ofFile(...));
$hashes; // Set
```

Since the computation doesn't rely on the filesystem it can be called on content that is not on the filesystem and that cannot be fitted in memory.

Examples:

```
use Innmind\OperatingSystem\Factory;
use Innmind\Http\{
    Message\Request\Request,
    Message\Method,
    ProtocolVersion,
};
use Innmind\Url\Url;
use Innmind\Server\Control\Server\Command;
use Innmind\Hash\{
    Hash,
    Value,
};

$os = Factory::build();
$os
    ->remote()
    ->http()(new Request(
        Url::of('https://github.com'),
        Method::get,
        ProtocolVersion::v20,
    ))
    ->map(static fn($success) => $success->response()->content())
    ->map(Hash::sha512->ofContent(...))
    ->match(
        static fn($value) => $value, // Value
        static fn() => null, // http call failed
    );

$output = $os
    ->control()
    ->processes()
    ->execute(
        Command::foreground('git')
            ->withOption('version'),
    )
    ->output()
    ->chunks()
    ->map(static fn($chunk) => $chunk[0]); // to only keep the chunk data

Hash::sha512->ofSequence($output); // Value
```

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance79

Regular maintenance activity

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~153 days

Recently: every ~217 days

Total

9

Last Release

152d ago

Major Versions

1.7.0 → 2.0.02026-02-01

PHP version history (3 changes)1.0.0PHP ~8.1

1.4.0PHP ~8.2

2.0.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (53 commits)")

---

Tags

hashfile

### Embed Badge

![Health badge](/badges/innmind-hash/health.svg)

```
[![Health](https://phpackages.com/badges/innmind-hash/health.svg)](https://phpackages.com/packages/innmind-hash)
```

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k679.9M2.5k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k285.7M1.0k](/packages/league-flysystem-aws-s3-v3)[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k41.5M133](/packages/knplabs-gaufrette)[knplabs/knp-gaufrette-bundle

Allows to easily use the Gaufrette library in a Symfony project

72430.0M103](/packages/knplabs-knp-gaufrette-bundle)[league/flysystem-local

Local filesystem adapter for Flysystem.

225267.1M89](/packages/league-flysystem-local)[league/flysystem-memory

In-memory filesystem adapter for Flysystem.

8737.3M276](/packages/league-flysystem-memory)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
