/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
setup/src/Magento/Setup/Model/CryptKeyGenerator.php
54 строки
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 11:23
22 окт 2025, 11:23
6c2f6e6
Код
Авторство
О чём код?
<?php /** * Copyright 2017 Adobe * All Rights Reserved. */ namespace Magento\Setup\Model; use Magento\Framework\Config\ConfigOptionsListConstants; use Magento\Framework\Math\Random; /** * Generates a crypt. */ class CryptKeyGenerator implements CryptKeyGeneratorInterface { /** * @var Random */ private $random; /** * CryptKeyGenerator constructor. * * @param Random $random */ public function __construct(Random $random) { $this->random = $random; } /** * Generates & returns a string to be used as crypt key. * * @return string * @throws \Magento\Framework\Exception\LocalizedException */ public function generate() { return $this->getRandomString(); } /** * Returns a random string. * * @return string * @throws \Magento\Framework\Exception\LocalizedException */ private function getRandomString() { return ConfigOptionsListConstants::STORE_KEY_ENCODED_RANDOM_STRING_PREFIX . $this->random->getRandomBytes(ConfigOptionsListConstants::STORE_KEY_RANDOM_STRING_SIZE); } }