定制 dynamophp/hash-bundle 二次开发

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

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

dynamophp/hash-bundle

最新稳定版本:1.1.0

Composer 安装命令:

composer require dynamophp/hash-bundle

包简介

Symfony bundle to use the dynamophp/hash library

README 文档

README

Goal

This Symfony bundle is a bridge to use the Dynamo-PHP-Hash Lib in a Symfony application.

The bundle provides an Interface (Dynamophp\HashBundle\Service\DynamoHasherInterface) to easily use a preconfigured Hasher.

Usage

composer require dynamophp/hash-bundle

Configuration

dynamo_php_hash:
  start_selection: 3
  end_selection: 0
  • start_selection : Selection the X first hexits from the result of the primary hash function.
  • end_selection : Selection the X last hexits from the result of the primary hash function.

More information about this implementation can be found here.

For the moment the bundle only provides a sha256 hasher version, which uses this algorithm as the primary hash function of the underlying hasher.

Usage in your code

In your Controller :

DemoController.php

#[Route('/demo/', name: 'demo_')]
class DemoController extends AbstractController
{
    #[Route(name: 'index')]
    public function demoIndex(DynamoHasherInterface $dynamoHasher): Response
    {
        dump($dynamoHasher->hash('ob')); // 48
        dump($dynamoHasher->hash('oc')); // 32
        dump($dynamoHasher->hash('od')); // 23
        dump($dynamoHasher->hash('a')); // 38
        dump($dynamoHasher->hash('b')); // 22
        
        return new JsonResponse('ok');
    }
}

In your Service :

DemoService.php

class DemoService extends AbstractController
{
    public __construct(private readonly DynamoHasherInterface $dynamoHasher){}
    
    public function doSmth(string $value): void
    {
        dd($dynamoHasher->hash($value)); 
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固