---
title: "Deprecation: #102762 - Deprecate GeneralUtility::hmac()"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:deprecation-102762-1710402828"
source: "Changelog/13.1/Deprecation-102762-GeneralUtilityhmac.rst"
typo3-version: "13.1"
typo3-major: 13
type: "deprecation"
issue: 102762
forge: "https://forge.typo3.org/issues/102762"
tags: ["Backend", "FullyScanned", "ext:core"]
rendered: "2026-10-03T08:19:36+00:00"
---

# Deprecation: #102762 - Deprecate GeneralUtility::hmac() {#deprecation-102762-1710402828}

See [forge#102762](https://forge.typo3.org/issues/102762)

## Description {#description}

The method `\TYPO3\CMS\Core\Utility\GeneralUtility::hmac()`
has been deprecated in TYPO3 v13 and will be removed with v14 in
favor of [Feature: #102761 - Introduce class to generate/validate HMAC hashes](https://docs.typo3.org/permalink/changelog:feature-102761-1704532036).

## Impact {#impact}

Usage of the method will raise a deprecation level log entry in
TYPO3 v13 and a fatal error in TYPO3 v14.

## Affected installations {#affected-installations}

All third-party extensions using `\TYPO3\CMS\Core\Utility\GeneralUtility::hmac()`.

## Migration {#migration}

All usages of `\TYPO3\CMS\Core\Utility\GeneralUtility::hmac()`
must be migrated to use the `hmac()` method in the class
`\TYPO3\CMS\Core\Crypto\HashService`.

### Before {#before}

```php
//use TYPO3\CMS\Core\Utility\GeneralUtility;

$hmac = GeneralUtility::hmac('some-input', 'some-secret');
```

### After {#after}

**Using `GeneralUtility::makeInstance()`**

```php
//use TYPO3\CMS\Core\Crypto\HashService;
//use TYPO3\CMS\Core\Utility\GeneralUtility;

$hashService = GeneralUtility::makeInstance(HashService::class);
$hmac = $hashService->hmac('some-input', 'some-secret');
```

**Using dependency injection**

```php
namespace MyVendor\MyExt\Services;

use TYPO3\CMS\Core\Crypto\HashService;
use TYPO3\CMS\Core\Utility\GeneralUtility;

final readonly class MyService
{
    public function __construct(
        private HashService $hashService,
    ) {}

    public function someMethod(): void
    {
        $hmac = $this->hashService->hmac('some-input', 'some-secret');
    }
}
```

If possible, use dependency injection to inject `HashService` into your class.
