定制 emgag/flysystem-hash 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

emgag/flysystem-hash

最新稳定版本:v1.0.4

Composer 安装命令:

composer require emgag/flysystem-hash

包简介

Flysystem plugin for generating a hash value of a given file

README 文档

README

build Software License Packagist Version

NOTE: Plugins were removed in Flysystem 2.0 and thus this library is only available for Flysystem 1.x.

A plugin for the Flysystem file system abstraction library to generate hash values of a file. See hash_algos() function for supported hash algorithms.

Tested with Local and WebDav adapters, but as the hash is built directly from the stream resource it should work for all other adapters as well.

Installation

composer require emgag/flysystem-hash

Usage

use Emgag\Flysystem\Hash\HashPlugin;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem; 

$fs = new Filesystem(new Local(__DIR__));
$fs->addPlugin(new HashPlugin);

// sha256 is default
$sha256 = $fs->hash('file.txt');
$sha256 = $fs->hash('file.txt', 'sha256');
$md5    = $fs->hash('file.txt', 'md5');
$sha1   = $fs->hash('file.txt', 'sha1');

License

flysystem-hash is licensed under the MIT License.

统计信息

  • 总下载量: 167.1k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 1
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-28