forked from metin2/web
Added authentication
This commit is contained in:
24
app/Hashing/MySQLHasher.php
Normal file
24
app/Hashing/MySQLHasher.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Hashing;
|
||||
|
||||
use Illuminate\Contracts\Hashing\Hasher;
|
||||
use Illuminate\Hashing\AbstractHasher;
|
||||
|
||||
class MySQLHasher extends AbstractHasher implements Hasher
|
||||
{
|
||||
public function make($value, array $options = []): string
|
||||
{
|
||||
return '*' . mb_strtoupper(sha1(sha1($value, true)));
|
||||
}
|
||||
|
||||
public function check($value, $hashedValue, array $options = []): bool
|
||||
{
|
||||
return $this->make($value) === $hashedValue;
|
||||
}
|
||||
|
||||
public function needsRehash($hashedValue, array $options = []): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user