D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
psa
/
admin
/
plib
/
modules
/
wp-toolkit
/
vendor
/
lcobucci
/
jwt
/
src
/
Signer
/
Filename :
Hmac.php
back
Copy
<?php declare (strict_types=1); namespace WPToolkitDependenciesIsolationPrefix\Lcobucci\JWT\Signer; use WPToolkitDependenciesIsolationPrefix\Lcobucci\JWT\Signer; use function hash_equals; use function hash_hmac; abstract class Hmac implements Signer { public final function sign(string $payload, Key $key) : string { return hash_hmac($this->algorithm(), $payload, $key->contents(), \true); } public final function verify(string $expected, string $payload, Key $key) : bool { return hash_equals($expected, $this->sign($payload, $key)); } public abstract function algorithm() : string; }