2017 © Pedro Peláez
 

library md5

md5

image

jarvis/md5

md5

  • Saturday, December 2, 2017
  • by Jarvis5780
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

说明

  1. composer require jarvis/md5, (*1)

    ​, (*2)

  2. reuqire安装 composer install, (*3)

    {
       "require": {
            "jarvis/md5": "~1.0"
       }
    }
    

    ​, (*4)

  3. Find the providers key in config/app.php and register the Captcha Service Provider., (*5)

    'providers' => [    
    Jarvis\Md5\Md5HasherProvider::class,
    ]
    
    'aliases' => [    
    'Md5Hasher' => Jarvis\Md5\Facade\Md5Hasher::class,
    ]
    

    ​, (*6)

  4. For Example, (*7)

    <?php
    
    namespace App\Http\Controllers\Test;
    
    use Illuminate\Http\Request;
    use App\Http\Controllers\Controller;
    use Md5Hasher;
    
    
    /**
    * Class JarvisController
    * @package App\Http\Controllers\Test
    */
    class JarvisController extends Controller
    {
       /**
        * 生成MD5加密值
        * @return mixed
        */
       public function md5(){
           //return app('jarvis-md5')->make('123456',['salt'=>'Jarvis']);
          return Md5Hasher::make('123456',['salt'=>'Jarvis']);
       }
    
       /**
        *检验是否正确
        */
       public function md5check(){
    
           //true
           //$bool = app('jarvis-md5')->check('123456','1f3653b1e691bac8a0cf38e84b416373',['salt'=>'Jarvis']);
    
           //false
           //$bool = app('jarvis-md5')->check('123456-','1f3653b1e691bac8a0cf38e84b416373',['salt'=>'Jarvis']);
           //dd($bool);
    
           $bool = Md5Hasher::check('123456-','1f3653b1e691bac8a0cf38e84b416373',['salt'=>'Jarvis']);
           dd($bool);
       }
    
    }
    
    

5.Tinker use check, (*8)

``` ☁ Laravel54 [master] ⚡php artisan tinker app('jarvis-md5')->make('123456',['salt'=>'Jarvis']) => "1f3653b1e691bac8a0cf38e84b416373", (*9)

app('jarvis-md5')->check('123456','1f3653b1e691bac8a0cf38e84b416373',['salt'=>'Jarvis']) => true app('jarvis-md5')->check('123456','1f3653b1e691bac8a0cf38e84b416373',['salt'=>'Jarvis1']) => false ``` ​, (*10)

The Versions

02/12 2017

dev-master

9999999-dev

md5

  Sources   Download

MIT

The Development Requires

by Jarvis

18/11 2017

1.0

1.0.0.0

md5

  Sources   Download

MIT

by Jarvis