---
title: "Deprecation: #73050 - Deprecated random generator methods in GeneralUtility"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:deprecation-73050"
source: "Changelog/8.0/Deprecation-73050-DeprecatedRandomGeneratorMethodsInGeneralUtility.rst"
typo3-version: "8.0"
typo3-major: 8
type: "deprecation"
issue: 73050
forge: "https://forge.typo3.org/issues/73050"
tags: ["PHP-API"]
rendered: "2026-09-18T17:00:34+00:00"
---

# Deprecation: #73050 - Deprecated random generator methods in GeneralUtility {#deprecation-73050}

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

## Description {#description}

The method `\TYPO3\CMS\Core\Utility\GeneralUtility::generateRandomBytes()` has been marked as deprecated in favor of `\TYPO3\CMS\Core\Crypto\Random->generateRandomBytes()`.

Also the method `\TYPO3\CMS\Core\Utility\GeneralUtility::getRandomHexString()` has been marked as deprecated in favor of `\TYPO3\CMS\Core\Crypto\Random->generateRandomHexString()`.

## Impact {#impact}

Calling this methods directly will trigger a deprecation log entry.

## Affected Installations {#affected-installations}

Any TYPO3 instance that use `GeneralUtility::generateRandomBytes()` or `GeneralUtility::getRandomHexString()` directly within an extension or third-party code.

## Migration {#migration}

Replace calls to `GeneralUtility::generateRandomBytes()` with `GeneralUtility::makeInstance(Random::class)->generateRandomBytes()`.

Also replace calls to `GeneralUtility::getRandomHexString()` with `GeneralUtility::makeInstance(Random::class)->generateRandomHexString()`.
