Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.humitest.fr
/
htdocs
/
vendor
/
liip
/
imagine-bundle
/
Imagine
/
Cache
/
/srv/data/web/vhosts/www.humitest.fr/htdocs/vendor/liip/imagine-bundle/Imagine/Cache/Signer.php
<?php /* * This file is part of the `liip/LiipImagineBundle` project. * * (c) https://github.com/liip/LiipImagineBundle/graphs/contributors * * For the full copyright and license information, please view the LICENSE.md * file that was distributed with this source code. */ namespace Liip\ImagineBundle\Imagine\Cache; class Signer implements SignerInterface { /** * @var string */ private $secret; /** * @param string $secret */ public function __construct($secret) { $this->secret = $secret; } /** * {@inheritdoc} */ public function sign($path, array $runtimeConfig = null) { if ($runtimeConfig) { array_walk_recursive($runtimeConfig, function (&$value) { $value = (string) $value; }); } return mb_substr(preg_replace('/[^a-zA-Z0-9-_]/', '', base64_encode(hash_hmac('sha256', ltrim($path, '/').(null === $runtimeConfig ?: serialize($runtimeConfig)), $this->secret, true))), 0, 8); } /** * {@inheritdoc} */ public function check($hash, $path, array $runtimeConfig = null) { return $hash === $this->sign($path, $runtimeConfig); } }