Coder Social home page Coder Social logo

qnibus / laravel-multi-hash Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 14 KB

Jasypt, sha256, sha512 and md5 integration for Laravel 9.x

Home Page: https://packagist.org/packages/qnibus/laravel-multi-hash

PHP 100.00%
hash jasypt sha256 laravel md5 php sha512

laravel-multi-hash's Introduction

LaravelMultiHash

Requirement

  • laravel 9.x or later
  • php 8.x

Usage

  1. Input your command line in below command.

    composer require qnibus/laravel-multi-hash
  2. Open /config/hashing.php in your laravel application and modify.

    'driver' => 'jasypt',// 'md5', 'sha256', 'sha512' or 'jasypt'
  3. Your code anywhere...

    # make hash
    Hash::make('some string');
    // result: NDM1M2M0ZmQ3MWYzNmJiZIXQlXLOzKcLkUKAZ6p6NPBBDA0zGwVCDkFuLmvbeozd
    
    # check hash
    Hash::check('some string', 'NDM1M2M0ZmQ3MWYzNmJiZIXQlXLOzKcLkUKAZ6p6NPBBDA0zGwVCDkFuLmvbeozd');
    // result: true
  4. Publish package config to config directory in laravel.

    php artisan vendor:publish --tag=multi-hashing-config
  5. Modify option in /config/multi-hashing.php

Better use

# Usage for jasypt
Hash::driver('jasypt')->make('some string');
Hash::driver('jasypt')->check('some string', $hashedString);

# Usage for sha256
Hash::driver('sha256')->make('some string');
Hash::driver('sha256')->check('some string', $hashedString);

# Usage for sha512
Hash::driver('sha512')->make('some string');
Hash::driver('sha512')->check('some string', $hashedString);

# Usage for md5
Hash::driver('md5')->make('some string');
Hash::driver('md5')->check('some string', $hashedString);

laravel-multi-hash's People

Stargazers

 avatar

Watchers

 avatar

Forkers

chris6578

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.