use TYPO3\CMS\Core\Utility\GeneralUtility; $key = 'secret_key'; $message = 'hello world'; $hmac = GeneralUtility::hmac($key, $message); echo $hmac;
use TYPO3\CMS\Core\Utility\GeneralUtility; $key = 'another_key'; $message = 'some text'; $algorithm = 'sha256'; $hmac = GeneralUtility::hmac($key, $message, $algorithm); echo $hmac;This code will generate an HMAC using the "another_key" and "some text" as inputs and using the SHA-256 algorithm to generate the hash value. The GeneralUtility hmac function is a part of the TYPO3 Core Utility library, which is included in the TYPO3 Core package.