Deprecation: #73050 - Deprecated random generator methods in GeneralUtility

See forge#73050

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

Calling this methods directly will trigger a deprecation log entry.

Affected Installations

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

Migration

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

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