35 if (!is_string(
$data)) {
48 $bytes = hash_hmac($this->algo, $this->data, $this->key, true);
60 $expected_token = $this->getToken();
61 return call_user_func($this->comparator, $expected_token,
$token);
Exception thrown if an argument is not of the expected type.
static encode($bytes)
Encode base 64 URL.
Component for creating HMAC tokens.
getToken()
Get the HMAC token in Base64URL encoding.
__construct(protected string $key, callable $comparator, $data, protected string $algo='sha256')
Constructor.
matchesToken($token)
Does the MAC match the given token?
if($container instanceof ElggGroup && $container->guid !=elgg_get_page_owner_guid()) $key