Neos\Flow\Security\Cryptography\HashService::appendHmac PHP Метод

appendHmac() публичный Метод

Appends a hash (HMAC) to a given string and returns the result
См. также: generateHmac()
public appendHmac ( string $string ) : string
$string string The string for which a hash should be generated
Результат string The original string with HMAC of the string appended
    public function appendHmac($string)
    {
        $hmac = $this->generateHmac($string);
        return $string . $hmac;
    }

Usage Example

Пример #1
0
 /**
  * Renders hidden form fields for referrer information about
  * the current request.
  *
  * @return string Hidden fields with referrer information
  */
 protected function renderHiddenReferrerFields()
 {
     $tagBuilder = new TagBuilder('input');
     $tagBuilder->addAttribute('type', 'hidden');
     $tagBuilder->addAttribute('name', $this->prefixFieldName('__state'));
     $serializedFormState = base64_encode(serialize($this->arguments['object']->getFormState()));
     $tagBuilder->addAttribute('value', $this->hashService->appendHmac($serializedFormState));
     return $tagBuilder->render();
 }
All Usage Examples Of Neos\Flow\Security\Cryptography\HashService::appendHmac