SecureRandom.php 921 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Security\Core\Util;
  11. @trigger_error('The '.__NAMESPACE__.'\SecureRandom class is deprecated since Symfony 2.8 and will be removed in 3.0. Use the random_bytes() function instead.', E_USER_DEPRECATED);
  12. /**
  13. * A secure random number generator implementation.
  14. *
  15. * @author Fabien Potencier <fabien@symfony.com>
  16. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  17. *
  18. * @deprecated since version 2.8, to be removed in 3.0. Use the random_bytes function instead
  19. */
  20. final class SecureRandom implements SecureRandomInterface
  21. {
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function nextBytes($nbBytes)
  26. {
  27. return random_bytes($nbBytes);
  28. }
  29. }