Supported Versions: PHP 5 >= 5.1.2, PHP 7, PHP 8, PECL hash >= 1.1
Generate a keyed hash value using the HMAC method
hash_hmac(    string $algo,    string $data,    string $key,    bool $binary false): string
    public function createNewToken()

    {

        return 
hash_hmac('sha256'Str::random(40), $this->hashKey);

    }
    public function generateAblySignature($channelName$socketId$userData null)

    {

        return 
hash_hmac(

            
'sha256',

            
sprintf('%s:%s%s'$socketId$channelName$userData ':'.json_encode($userData) : ''),

            
$this->getPrivateToken(),

        );

    }
        $encodedUser json_encode($user);

        
$decodedString "{$request->socket_id}::user::{$encodedUser}";



        
$auth $settings['auth_key'].':'.hash_hmac(

            
'sha256'$decodedString$settings['secret']

        );



        return [

            
'auth' => $auth,
    public static function create($cookieName$key)

    {

        return 
hash_hmac('sha1'$cookieName.'v2'$key).'|';

    }
    protected function hash($iv$value)

    {

        return 
hash_hmac('sha256'$iv.$value$this->key);

    }
        return new Cookie('laravel_maintenance'base64_encode(json_encode([

            
'expires_at' => $expiresAt->getTimestamp(),

            
'mac' => hash_hmac('sha256'$expiresAt->getTimestamp(), $key),

        ])), 
$expiresAtconfig('session.path'), config('session.domain'));

    }
        return is_array($payload) &&

            
is_numeric($payload['expires_at'] ?? null) &&

            isset(
$payload['mac']) &&

            
hash_equals(hash_hmac('sha256'$payload['expires_at'], $key), $payload['mac']) &&

            (int) 
$payload['expires_at'] >= Carbon::now()->getTimestamp();

    }

}
        $key call_user_func($this->keyResolver);



        return 
$this->route($name$parameters + [

            
'signature' => hash_hmac('sha256'$this->route($name$parameters$absolute), $key),

        ], 
$absolute);

    }
        $original rtrim($url.'?'.$queryString'?');



        
$signature hash_hmac('sha256'$originalcall_user_func($this->keyResolver));



        return 
hash_equals($signature, (string) $request->query('signature'''));

    }