bantu/stream-filter-hash 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bantu/stream-filter-hash

Composer 安装命令:

composer require bantu/stream-filter-hash

包简介

Stream filter piping data through a hash function.

README 文档

README

Travis Build Status Scrutinizer Build Status Code Coverage Scrutinizer Code Quality

Installation

Through composer:

$ composer require bantu/stream-filter-hash

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

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);

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-27