1
0
forked from metin2/web
web/app/Hashing/MySQLHasher.php
2023-07-28 19:57:16 +03:00

25 lines
560 B
PHP

<?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;
}
}