PHPackages                             wyrihaximus/react-stream-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. wyrihaximus/react-stream-hash

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wyrihaximus/react-stream-hash
=============================

On the fly hash calculator for ReactPHP streams

1.1.0(7y ago)2301[2 PRs](https://github.com/WyriHaximus/reactphp-stream-hash/pulls)MITPHPPHP ^7.2CI failing

Since Jul 14Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/WyriHaximus/reactphp-stream-hash)[ Packagist](https://packagist.org/packages/wyrihaximus/react-stream-hash)[ RSS](/packages/wyrihaximus-react-stream-hash/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (7)Used By (0)

On the fly hash calculator for [ReactPHP](https://github.com/reactphp/) streams
===============================================================================

[](#on-the-fly-hash-calculator-for-reactphp-streams)

[![Linux Build Status](https://camo.githubusercontent.com/9d8258db14a39481154e4a0dc3be46f36497e2ca63cd949b5f1c15f80ea814d6/68747470733a2f2f7472617669732d63692e6f72672f57797269486178696d75732f72656163747068702d73747265616d2d686173682e706e67)](https://travis-ci.org/WyriHaximus/reactphp-stream-hash)[![Latest Stable Version](https://camo.githubusercontent.com/1d87aeeb20c341f09d78c96d76e4af5af562de719ee9070a9425d376a48195b1/68747470733a2f2f706f7365722e707567782e6f72672f57797269486178696d75732f72656163742d73747265616d2d686173682f762f737461626c652e706e67)](https://packagist.org/packages/WyriHaximus/react-stream-hash)[![Total Downloads](https://camo.githubusercontent.com/ea6213c3ac46b381386fb69a0e8b6701455651331e84f520b63a163f02148658/68747470733a2f2f706f7365722e707567782e6f72672f57797269486178696d75732f72656163742d73747265616d2d686173682f646f776e6c6f6164732e706e67)](https://packagist.org/packages/WyriHaximus/react-stream-hash/stats)[![Code Coverage](https://camo.githubusercontent.com/fc7ec4393ffd9e180fc93078c5b401e89d20d26cf46cf14ef54b08af7961c6f2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f57797269486178696d75732f72656163747068702d73747265616d2d686173682f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/WyriHaximus/reactphp-stream-hash/?branch=master)[![License](https://camo.githubusercontent.com/0ae95b0db08deaf272d2e64372e8979910d76527306d3d6b98bde873fb065c19/68747470733a2f2f706f7365722e707567782e6f72672f57797269486178696d75732f72656163742d73747265616d2d686173682f6c6963656e73652e706e67)](https://packagist.org/packages/wyrihaximus/react-stream-hash)[![PHP 7 ready](https://camo.githubusercontent.com/6140f98c44d9ef7549a812601b8324802e34bb72cf38490e94f3c4ee4c0a8cd0/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f57797269486178696d75732f72656163747068702d73747265616d2d686173682f62616467652e737667)](https://travis-ci.org/WyriHaximus/reactphp-stream-hash)

### Installation

[](#installation)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.

```
composer require wyrihaximus/react-stream-hash

```

Usage
-----

[](#usage)

Writable stream:

```
$algo = 'sha512'; // Change to any desired algo from hash_algos()
$streamToHash = new ThroughStream();
// Constructor accepts a third $key argument in case you want a HMAC hash
$stream = new WritableStreamHash($streamToHash, $algo);
$stream->on('hash', function ($hash, $algo) {
    // Do with what you need the hash for
});
$stream->on('hash_raw', function ($hash, $algo) {
    // Do with what you need the raw hash for
});

// Write to the stream
$stream->write('foo');
$stream->end('bar');
```

Readable stream:

```
$algo = 'sha512'; // Change to any desired algo from hash_algos()
$streamToHash = new ThroughStream();
// Constructor accepts a third $key argument in case you want a HMAC hash
$stream = new ReadableStreamHash($streamToHash, $algo);
$stream->on('hash', function ($hash, $algo) {
    // Do with what you need the hash for
});
$stream->on('hash_raw', function ($hash, $algo) {
    // Do with what you need the raw hash for
});

// The readable emits data when written to
$streamToHash->write('foo');
$streamToHash->end('bar');
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

Copyright 2017 [Cees-Jan Kiewiet](http://wyrihaximus.net/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance40

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 60.4% 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 ~268 days

Total

3

Last Release

2736d ago

PHP version history (2 changes)1.0.0PHP ^7.0

1.1.0PHP ^7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/147145?v=4)[Cees-Jan Kiewiet](/maintainers/WyriHaximus)[@WyriHaximus](https://github.com/WyriHaximus)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (32 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (3 commits)")

---

Tags

hacktoberfesthashphpphp7reactphpstream

### Embed Badge

![Health badge](/badges/wyrihaximus-react-stream-hash/health.svg)

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

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k245.4M24.0k](/packages/friendsofphp-php-cs-fixer)[react/react

ReactPHP: Event-driven, non-blocking I/O with PHP.

9.1k3.6M65](/packages/react-react)[react/child-process

Event-driven library for executing child processes with ReactPHP.

34185.8M150](/packages/react-child-process)[clue/utf8-react

Streaming UTF-8 parser, built on top of ReactPHP.

6610.7M3](/packages/clue-utf8-react)[llm/mcp-server

PHP SDK for building MCP servers

441.3k](/packages/llm-mcp-server)

PHPackages © 2026

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