PHPackages                             bantu/stream-filter-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. bantu/stream-filter-hash

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

bantu/stream-filter-hash
========================

Stream filter piping data through a hash function.

371PHP

Since Mar 5Pushed 11y agoCompare

[ Source](https://github.com/bantuXorg/php-stream-filter-hash)[ Packagist](https://packagist.org/packages/bantu/stream-filter-hash)[ RSS](/packages/bantu-stream-filter-hash/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

[![Travis Build Status](https://camo.githubusercontent.com/2a023fbe4ad8f63d44b113f6c5bf2ef358078ca0d2eff88507c4ce2e4c8a044a/68747470733a2f2f7472617669732d63692e6f72672f62616e7475586f72672f7068702d73747265616d2d66696c7465722d686173682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bantuXorg/php-stream-filter-hash)[![Scrutinizer Build Status](https://camo.githubusercontent.com/007a0fd9612981650ed70ec1550d888b67c38347be898f75d90a672e1e28f443/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62616e7475586f72672f7068702d73747265616d2d66696c7465722d686173682f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bantuXorg/php-stream-filter-hash/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/8b0397fa4f32c5f1d03fb25dc2f53fb84a456f4994676f2a51f84b4f1d7a469f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62616e7475586f72672f7068702d73747265616d2d66696c7465722d686173682f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bantuXorg/php-stream-filter-hash/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e3fa12e0cedae019cc91c14d68b0532b8e864b723f58009ac221de537438dd91/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62616e7475586f72672f7068702d73747265616d2d66696c7465722d686173682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bantuXorg/php-stream-filter-hash/?branch=master)

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

[](#installation)

Through [composer](http://getcomposer.org):

```
$ composer require bantu/stream-filter-hash
```

Usage
-----

[](#usage)

Use `HashFilter::appendToWriteStream($stream, $params)` to calculate a checksum of everything written to `$stream`. The `$params` argument has to be an array specifying the hash algorithm to use via the `algo` array key (e.g. `md5` or `sha256`). Furthermore `$params` either needs to be passed a callback via the `callback` array key or an output stream using the `stream` array key.

### Example using Stream

[](#example-using-stream)

Create an `output.txt.sha256` file containing a checksum of everything you write to `output.txt`.

```
require 'vendor/autoload.php';
$dest = fopen('output.txt', 'w+b');
$hash = fopen('output.txt.md5', 'w+b');
\bantu\StreamFilter\Hash\HashFilter::appendToWriteStream($dest, array(
    'algo' => 'sha256', 'stream' => $hash,
));
fwrite($dest, 'The quick brown fox jumps over the lazy dog');
fclose($dest);
fclose($hash);
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/700dfc1275a703602adf70d48a964c755c19ac49d0b48224aabd95611a336099?d=identicon)[bantu](/maintainers/bantu)

---

Top Contributors

[![bantu](https://avatars.githubusercontent.com/u/189375?v=4)](https://github.com/bantu "bantu (25 commits)")

### Embed Badge

![Health badge](/badges/bantu-stream-filter-hash/health.svg)

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

###  Alternatives

[adumskis/laravel-advert

Advertising helper for laravel

4817.4k](/packages/adumskis-laravel-advert)[fooman/sameorderinvoicenumber-m2

Use the Magento order number as the related invoice, shipment and credit memo number.

10124.3k](/packages/fooman-sameorderinvoicenumber-m2)

PHPackages © 2026

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