Spaces:
No application file
No application file
File size: 601 Bytes
d2897cd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<?php
declare(strict_types=1);
namespace Mautic\EmailBundle\Helper;
use Mautic\CoreBundle\Helper\CoreParametersHelper;
final class MailHashHelper
{
public function __construct(private CoreParametersHelper $coreParametersHelper)
{
}
public function getEmailHash(string $email): string
{
$secret = $this->coreParametersHelper->get('secret_key');
return self::getEmailHashForSecret($email, $secret);
}
public static function getEmailHashForSecret(string $email, string $secret): string
{
return hash_hmac('sha256', $email, $secret);
}
}
|