terrylucas/md5hasher

Laravel 中使用 md5 支持功能

dev-master 2017-08-01 02:37 UTC

This package is not auto-updated.

Last update: 2024-09-23 06:57:08 UTC


README

Build Status StyleCI

安装

使用 composer 安装此包

composer require terrylucas/md5hasher dev-master

更新 composer 后,将 ServiceProvider 添加到 config/app.php 文件中的 providers 数组中

Laravel 5.5 使用包自动发现,因此无需手动添加 ServiceProvider

Laravel 5.x

TerryLucas2017\Hasher\LucasMD5Provider::class,

用法

    $hashValue = app('lucasmd5')->make('123456');

    $isEqual = app('lucasmd5')->check('123456' , $hashValue);

    $hashValue = app('lucasmd5')->make('123456' , ['salt' => 'terry']);

    $isEqual = app('lucasmd5')->check('123456' , $hashValue , ['salt' => 'terry']);