Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Hash Bundle Laravel Package

dynamophp/hash-bundle

View on GitHub
Deep Wiki
Context7

Dynamo-PHP-Hash-Bundle

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

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels