vendor/symfony/security-core/Encoder/SodiumPasswordEncoder.php line 16

Open in your IDE?
  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\Encoder;
  11. use Symfony\Component\PasswordHasher\Hasher\SodiumPasswordHasher;
  12. trigger_deprecation('symfony/security-core', '5.3', 'The "%s" class is deprecated, use "%s" instead.', SodiumPasswordEncoder::class, SodiumPasswordHasher::class);
  13. /**
  14. * Hashes passwords using libsodium.
  15. *
  16. * @author Robin Chalas <robin.chalas@gmail.com>
  17. * @author Zan Baldwin <hello@zanbaldwin.com>
  18. * @author Dominik Müller <dominik.mueller@jkweb.ch>
  19. *
  20. * @deprecated since Symfony 5.3, use {@link SodiumPasswordHasher} instead
  21. */
  22. final class SodiumPasswordEncoder implements PasswordEncoderInterface, SelfSaltingEncoderInterface
  23. {
  24. use LegacyEncoderTrait;
  25. public function __construct(?int $opsLimit = null, ?int $memLimit = null)
  26. {
  27. $this->hasher = new SodiumPasswordHasher($opsLimit, $memLimit);
  28. }
  29. public static function isSupported(): bool
  30. {
  31. return SodiumPasswordHasher::isSupported();
  32. }
  33. }